﻿using System;
namespace Producers.Ehr.Xtee.Riik.Ee.Producer.Ehr {
    
    
    [global::Xtee.Core.Attributes.XmlTypeAttribute(Name="EN_EhitiseAndmed_response", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse))]
    public class ENEhitiseAndmedResponseSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
        
        protected IENEhitiseAndmedResponse clazz;
        
        public ENEhitiseAndmedResponseSerializer(IENEhitiseAndmedResponse clazz) {
            this.clazz = clazz;
        }
        
        public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
            base.WriteXml(Writer);
            Writer.WriteStartElement("ehitised");
            if (clazz.Ehitised!=null) {
                global::Xtee.Core.SerializationMetadata metaEhitised = this.GetMetaData(clazz.Ehitised);
                Writer.WriteTypeAttribute(metaEhitised.TypeQualifiedName.Namespace, metaEhitised.TypeQualifiedName.Name);
                metaEhitised.NewSerializer(clazz.Ehitised).WriteXml(Writer);
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Ehitised");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("ehitised_lisa");
            if (clazz.EhitisedLisa!=null) {
                global::Xtee.Core.SerializationMetadata metaEhitisedLisa = this.GetMetaData(clazz.EhitisedLisa);
                Writer.WriteTypeAttribute(metaEhitisedLisa.TypeQualifiedName.Namespace, metaEhitisedLisa.TypeQualifiedName.Name);
                metaEhitisedLisa.NewSerializer(clazz.EhitisedLisa).WriteXml(Writer);
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : EhitisedLisa");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("aadressid_array");
            if (clazz.AadressidArray!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>EN_EhitiseAndmed_response>aadressid_array>aadressid", "http://producers.ehr.xtee.riik.ee/producer/ehr", clazz.AadressidArray.Count);
                for (int x = 0; ((clazz.AadressidArray != null) 
                            && (x < clazz.AadressidArray.Count)); x = (x + 1)) {
                    if (clazz.AadressidArray[x]!=null) {
                        Writer.WriteStartElement("aadressid");
                        global::Xtee.Core.SerializationMetadata metaAadressidArray = this.GetMetaData(clazz.AadressidArray[x]);
                        Writer.WriteTypeAttribute(metaAadressidArray.TypeQualifiedName.Namespace, metaAadressidArray.TypeQualifiedName.Name);
                        metaAadressidArray.NewSerializer(clazz.AadressidArray[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : AadressidArray");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("katastriyksused_array");
            if (clazz.KatastriyksusedArray!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>EN_EhitiseAndmed_response>katastriyksused_array>katastriyksused", "http://producers.ehr.xtee.riik.ee/producer/ehr", clazz.KatastriyksusedArray.Count);
                for (int x = 0; ((clazz.KatastriyksusedArray != null) 
                            && (x < clazz.KatastriyksusedArray.Count)); x = (x + 1)) {
                    if (clazz.KatastriyksusedArray[x]!=null) {
                        Writer.WriteStartElement("katastriyksused");
                        global::Xtee.Core.SerializationMetadata metaKatastriyksusedArray = this.GetMetaData(clazz.KatastriyksusedArray[x]);
                        Writer.WriteTypeAttribute(metaKatastriyksusedArray.TypeQualifiedName.Namespace, metaKatastriyksusedArray.TypeQualifiedName.Name);
                        metaKatastriyksusedArray.NewSerializer(clazz.KatastriyksusedArray[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : KatastriyksusedArray");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("ehitis_katastriyksus_array");
            if (clazz.EhitisKatastriyksusArray!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>EN_EhitiseAndmed_response>ehitis_katastriyksus_array>ehitis_katastriyksus", "http://producers.ehr.xtee.riik.ee/producer/ehr", clazz.EhitisKatastriyksusArray.Count);
                for (int x = 0; ((clazz.EhitisKatastriyksusArray != null) 
                            && (x < clazz.EhitisKatastriyksusArray.Count)); x = (x + 1)) {
                    if (clazz.EhitisKatastriyksusArray[x]!=null) {
                        Writer.WriteStartElement("ehitis_katastriyksus");
                        global::Xtee.Core.SerializationMetadata metaEhitisKatastriyksusArray = this.GetMetaData(clazz.EhitisKatastriyksusArray[x]);
                        Writer.WriteTypeAttribute(metaEhitisKatastriyksusArray.TypeQualifiedName.Namespace, metaEhitisKatastriyksusArray.TypeQualifiedName.Name);
                        metaEhitisKatastriyksusArray.NewSerializer(clazz.EhitisKatastriyksusArray[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : EhitisKatastriyksusArray");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("tehnilised_naitajad_array");
            if (clazz.TehnilisedNaitajadArray!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>EN_EhitiseAndmed_response>tehnilised_naitajad_array>tehnilised_naitajad", "http://producers.ehr.xtee.riik.ee/producer/ehr", clazz.TehnilisedNaitajadArray.Count);
                for (int x = 0; ((clazz.TehnilisedNaitajadArray != null) 
                            && (x < clazz.TehnilisedNaitajadArray.Count)); x = (x + 1)) {
                    if (clazz.TehnilisedNaitajadArray[x]!=null) {
                        Writer.WriteStartElement("tehnilised_naitajad");
                        global::Xtee.Core.SerializationMetadata metaTehnilisedNaitajadArray = this.GetMetaData(clazz.TehnilisedNaitajadArray[x]);
                        Writer.WriteTypeAttribute(metaTehnilisedNaitajadArray.TypeQualifiedName.Namespace, metaTehnilisedNaitajadArray.TypeQualifiedName.Name);
                        metaTehnilisedNaitajadArray.NewSerializer(clazz.TehnilisedNaitajadArray[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : TehnilisedNaitajadArray");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("vallasomandid_array");
            if (clazz.VallasomandidArray!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid", "http://producers.ehr.xtee.riik.ee/producer/ehr", clazz.VallasomandidArray.Count);
                for (int x = 0; ((clazz.VallasomandidArray != null) 
                            && (x < clazz.VallasomandidArray.Count)); x = (x + 1)) {
                    if (clazz.VallasomandidArray[x]!=null) {
                        Writer.WriteStartElement("vallasomandid");
                        global::Xtee.Core.SerializationMetadata metaVallasomandidArray = this.GetMetaData(clazz.VallasomandidArray[x]);
                        Writer.WriteTypeAttribute(metaVallasomandidArray.TypeQualifiedName.Namespace, metaVallasomandidArray.TypeQualifiedName.Name);
                        metaVallasomandidArray.NewSerializer(clazz.VallasomandidArray[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : VallasomandidArray");
            }
            Writer.WriteEndElement();
            if (clazz.VallasomandidRegKood!=null) {
                Writer.WriteStartElement("vallasomandid_reg_kood");
                Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VallasomandidRegKood))).ToString());
                Writer.WriteEndElement();
            }
            Writer.WriteStartElement("ehitise_osad_array");
            if (clazz.EhitiseOsadArray!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad", "http://producers.ehr.xtee.riik.ee/producer/ehr", clazz.EhitiseOsadArray.Count);
                for (int x = 0; ((clazz.EhitiseOsadArray != null) 
                            && (x < clazz.EhitiseOsadArray.Count)); x = (x + 1)) {
                    if (clazz.EhitiseOsadArray[x]!=null) {
                        Writer.WriteStartElement("ehitise_osad");
                        global::Xtee.Core.SerializationMetadata metaEhitiseOsadArray = this.GetMetaData(clazz.EhitiseOsadArray[x]);
                        Writer.WriteTypeAttribute(metaEhitiseOsadArray.TypeQualifiedName.Namespace, metaEhitiseOsadArray.TypeQualifiedName.Name);
                        metaEhitiseOsadArray.NewSerializer(clazz.EhitiseOsadArray[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : EhitiseOsadArray");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("ehitise_osa_tehn_naitajad_array");
            if (clazz.EhitiseOsaTehnNaitajadArray!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>EN_EhitiseAndmed_response>ehitise_osa_tehn_naitajad_array>ehitise_osa_tehn_naitajad", "http://producers.ehr.xtee.riik.ee/producer/ehr", clazz.EhitiseOsaTehnNaitajadArray.Count);
                for (int x = 0; ((clazz.EhitiseOsaTehnNaitajadArray != null) 
                            && (x < clazz.EhitiseOsaTehnNaitajadArray.Count)); x = (x + 1)) {
                    if (clazz.EhitiseOsaTehnNaitajadArray[x]!=null) {
                        Writer.WriteStartElement("ehitise_osa_tehn_naitajad");
                        global::Xtee.Core.SerializationMetadata metaEhitiseOsaTehnNaitajadArray = this.GetMetaData(clazz.EhitiseOsaTehnNaitajadArray[x]);
                        Writer.WriteTypeAttribute(metaEhitiseOsaTehnNaitajadArray.TypeQualifiedName.Namespace, metaEhitiseOsaTehnNaitajadArray.TypeQualifiedName.Name);
                        metaEhitiseOsaTehnNaitajadArray.NewSerializer(clazz.EhitiseOsaTehnNaitajadArray[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : EhitiseOsaTehnNaitajadArray");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("ehitis_kasutamisotstarve_array");
            if (clazz.EhitisKasutamisotstarveArray!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>EN_EhitiseAndmed_response>ehitis_kasutamisotstarve_array>ehitis_kasutamisotstarve", "http://producers.ehr.xtee.riik.ee/producer/ehr", clazz.EhitisKasutamisotstarveArray.Count);
                for (int x = 0; ((clazz.EhitisKasutamisotstarveArray != null) 
                            && (x < clazz.EhitisKasutamisotstarveArray.Count)); x = (x + 1)) {
                    if (clazz.EhitisKasutamisotstarveArray[x]!=null) {
                        Writer.WriteStartElement("ehitis_kasutamisotstarve");
                        global::Xtee.Core.SerializationMetadata metaEhitisKasutamisotstarveArray = this.GetMetaData(clazz.EhitisKasutamisotstarveArray[x]);
                        Writer.WriteTypeAttribute(metaEhitisKasutamisotstarveArray.TypeQualifiedName.Namespace, metaEhitisKasutamisotstarveArray.TypeQualifiedName.Name);
                        metaEhitisKasutamisotstarveArray.NewSerializer(clazz.EhitisKasutamisotstarveArray[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : EhitisKasutamisotstarveArray");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("arestid_keelud_array");
            if (clazz.ArestidKeeludArray!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud", "http://producers.ehr.xtee.riik.ee/producer/ehr", clazz.ArestidKeeludArray.Count);
                for (int x = 0; ((clazz.ArestidKeeludArray != null) 
                            && (x < clazz.ArestidKeeludArray.Count)); x = (x + 1)) {
                    if (clazz.ArestidKeeludArray[x]!=null) {
                        Writer.WriteStartElement("arestid_keelud");
                        global::Xtee.Core.SerializationMetadata metaArestidKeeludArray = this.GetMetaData(clazz.ArestidKeeludArray[x]);
                        Writer.WriteTypeAttribute(metaArestidKeeludArray.TypeQualifiedName.Namespace, metaArestidKeeludArray.TypeQualifiedName.Name);
                        metaArestidKeeludArray.NewSerializer(clazz.ArestidKeeludArray[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ArestidKeeludArray");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("omaniku_piirangud_array");
            if (clazz.OmanikuPiirangudArray!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>EN_EhitiseAndmed_response>omaniku_piirangud_array>omaniku_piirangud", "http://producers.ehr.xtee.riik.ee/producer/ehr", clazz.OmanikuPiirangudArray.Count);
                for (int x = 0; ((clazz.OmanikuPiirangudArray != null) 
                            && (x < clazz.OmanikuPiirangudArray.Count)); x = (x + 1)) {
                    if (clazz.OmanikuPiirangudArray[x]!=null) {
                        Writer.WriteStartElement("omaniku_piirangud");
                        global::Xtee.Core.SerializationMetadata metaOmanikuPiirangudArray = this.GetMetaData(clazz.OmanikuPiirangudArray[x]);
                        Writer.WriteTypeAttribute(metaOmanikuPiirangudArray.TypeQualifiedName.Namespace, metaOmanikuPiirangudArray.TypeQualifiedName.Name);
                        metaOmanikuPiirangudArray.NewSerializer(clazz.OmanikuPiirangudArray[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : OmanikuPiirangudArray");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("pandid_array");
            if (clazz.PandidArray!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>EN_EhitiseAndmed_response>pandid_array>pandid", "http://producers.ehr.xtee.riik.ee/producer/ehr", clazz.PandidArray.Count);
                for (int x = 0; ((clazz.PandidArray != null) 
                            && (x < clazz.PandidArray.Count)); x = (x + 1)) {
                    if (clazz.PandidArray[x]!=null) {
                        Writer.WriteStartElement("pandid");
                        global::Xtee.Core.SerializationMetadata metaPandidArray = this.GetMetaData(clazz.PandidArray[x]);
                        Writer.WriteTypeAttribute(metaPandidArray.TypeQualifiedName.Namespace, metaPandidArray.TypeQualifiedName.Name);
                        metaPandidArray.NewSerializer(clazz.PandidArray[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : PandidArray");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("probleemid_array");
            if (clazz.ProbleemidArray!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>EN_EhitiseAndmed_response>probleemid_array>probleemid", "http://producers.ehr.xtee.riik.ee/producer/ehr", clazz.ProbleemidArray.Count);
                for (int x = 0; ((clazz.ProbleemidArray != null) 
                            && (x < clazz.ProbleemidArray.Count)); x = (x + 1)) {
                    if (clazz.ProbleemidArray[x]!=null) {
                        Writer.WriteStartElement("probleemid");
                        global::Xtee.Core.SerializationMetadata metaProbleemidArray = this.GetMetaData(clazz.ProbleemidArray[x]);
                        Writer.WriteTypeAttribute(metaProbleemidArray.TypeQualifiedName.Namespace, metaProbleemidArray.TypeQualifiedName.Name);
                        metaProbleemidArray.NewSerializer(clazz.ProbleemidArray[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ProbleemidArray");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("toalisuse_spetsid_array");
            if (clazz.ToalisuseSpetsidArray!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>EN_EhitiseAndmed_response>toalisuse_spetsid_array>toalisuse_spetsid", "http://producers.ehr.xtee.riik.ee/producer/ehr", clazz.ToalisuseSpetsidArray.Count);
                for (int x = 0; ((clazz.ToalisuseSpetsidArray != null) 
                            && (x < clazz.ToalisuseSpetsidArray.Count)); x = (x + 1)) {
                    if (clazz.ToalisuseSpetsidArray[x]!=null) {
                        Writer.WriteStartElement("toalisuse_spetsid");
                        global::Xtee.Core.SerializationMetadata metaToalisuseSpetsidArray = this.GetMetaData(clazz.ToalisuseSpetsidArray[x]);
                        Writer.WriteTypeAttribute(metaToalisuseSpetsidArray.TypeQualifiedName.Namespace, metaToalisuseSpetsidArray.TypeQualifiedName.Name);
                        metaToalisuseSpetsidArray.NewSerializer(clazz.ToalisuseSpetsidArray[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : ToalisuseSpetsidArray");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("kujud");
            if (clazz.Kujud!=null) {
                global::Xtee.Core.SerializationMetadata metaKujud = this.GetMetaData(clazz.Kujud);
                Writer.WriteTypeAttribute(metaKujud.TypeQualifiedName.Namespace, metaKujud.TypeQualifiedName.Name);
                metaKujud.NewSerializer(clazz.Kujud).WriteXml(Writer);
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : Kujud");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("yks_kuju");
            if (clazz.YksKuju!=null) {
                global::Xtee.Core.SerializationMetadata metaYksKuju = this.GetMetaData(clazz.YksKuju);
                Writer.WriteTypeAttribute(metaYksKuju.TypeQualifiedName.Namespace, metaYksKuju.TypeQualifiedName.Name);
                metaYksKuju.NewSerializer(clazz.YksKuju).WriteXml(Writer);
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : YksKuju");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("kuju_koordinaadid_array");
            if (clazz.KujuKoordinaadidArray!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>EN_EhitiseAndmed_response>kuju_koordinaadid_array>kuju_koordinaadid", "http://producers.ehr.xtee.riik.ee/producer/ehr", clazz.KujuKoordinaadidArray.Count);
                for (int x = 0; ((clazz.KujuKoordinaadidArray != null) 
                            && (x < clazz.KujuKoordinaadidArray.Count)); x = (x + 1)) {
                    if (clazz.KujuKoordinaadidArray[x]!=null) {
                        Writer.WriteStartElement("kuju_koordinaadid");
                        global::Xtee.Core.SerializationMetadata metaKujuKoordinaadidArray = this.GetMetaData(clazz.KujuKoordinaadidArray[x]);
                        Writer.WriteTypeAttribute(metaKujuKoordinaadidArray.TypeQualifiedName.Namespace, metaKujuKoordinaadidArray.TypeQualifiedName.Name);
                        metaKujuKoordinaadidArray.NewSerializer(clazz.KujuKoordinaadidArray[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : KujuKoordinaadidArray");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("anon_ehr_lingid");
            if (clazz.AnonEhrLingid!=null) {
                global::Xtee.Core.SerializationMetadata metaAnonEhrLingid = this.GetMetaData(clazz.AnonEhrLingid);
                Writer.WriteTypeAttribute(metaAnonEhrLingid.TypeQualifiedName.Namespace, metaAnonEhrLingid.TypeQualifiedName.Name);
                metaAnonEhrLingid.NewSerializer(clazz.AnonEhrLingid).WriteXml(Writer);
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : AnonEhrLingid");
            }
            Writer.WriteEndElement();
            Writer.WriteStartElement("kasuliku_pinna_spets_array");
            if (clazz.KasulikuPinnaSpetsArray!=null) {
                Writer.WriteTypeAttribute("http://schemas.xmlsoap.org/soap/encoding/", "Array");
                Writer.WriteArrayTypeAttribute(">>>EN_EhitiseAndmed_response>kasuliku_pinna_spets_array>kasuliku_pinna_spets", "http://producers.ehr.xtee.riik.ee/producer/ehr", clazz.KasulikuPinnaSpetsArray.Count);
                for (int x = 0; ((clazz.KasulikuPinnaSpetsArray != null) 
                            && (x < clazz.KasulikuPinnaSpetsArray.Count)); x = (x + 1)) {
                    if (clazz.KasulikuPinnaSpetsArray[x]!=null) {
                        Writer.WriteStartElement("kasuliku_pinna_spets");
                        global::Xtee.Core.SerializationMetadata metaKasulikuPinnaSpetsArray = this.GetMetaData(clazz.KasulikuPinnaSpetsArray[x]);
                        Writer.WriteTypeAttribute(metaKasulikuPinnaSpetsArray.TypeQualifiedName.Namespace, metaKasulikuPinnaSpetsArray.TypeQualifiedName.Name);
                        metaKasulikuPinnaSpetsArray.NewSerializer(clazz.KasulikuPinnaSpetsArray[x]).WriteXml(Writer);
                        Writer.WriteEndElement();
                    }
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.NillableNotAllowedException("Nullable is not allowed for element : KasulikuPinnaSpetsArray");
            }
            Writer.WriteEndElement();
        }
        
        public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
            base.ReadXml(Reader);
            if (Reader.LocalName=="ehitised") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>ehitised");
                }
                global::Xtee.Core.SerializationMetadata metaEhitised = this.GetMetaData<ENEhitiseAndmedResponse.IEhitisedType>(Reader, ">>EN_EhitiseAndmed_response>ehitised", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                clazz.Ehitised = metaEhitised.NewEntity<ENEhitiseAndmedResponse.IEhitisedType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("ehitised");
                    metaEhitised.NewSerializer(clazz.Ehitised).ReadXml(Reader);
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>ehitised", Reader.LocalName);
            }
            if (Reader.LocalName=="ehitised_lisa") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>ehitised_lisa");
                }
                global::Xtee.Core.SerializationMetadata metaEhitisedLisa = this.GetMetaData<ENEhitiseAndmedResponse.IEhitisedLisaType>(Reader, ">>EN_EhitiseAndmed_response>ehitised_lisa", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                clazz.EhitisedLisa = metaEhitisedLisa.NewEntity<ENEhitiseAndmedResponse.IEhitisedLisaType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("ehitised_lisa");
                    metaEhitisedLisa.NewSerializer(clazz.EhitisedLisa).ReadXml(Reader);
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>ehitised_lisa", Reader.LocalName);
            }
            if (Reader.LocalName=="aadressid_array") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>aadressid_array");
                }
                clazz.AadressidArray = new System.Collections.Generic.List<ENEhitiseAndmedResponse.IAadressidArrayType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("aadressid_array");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "aadressid")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>aadressid_array>aadressid");
                        }
                        global::Xtee.Core.SerializationMetadata metaAadressidArray = this.GetMetaData<ENEhitiseAndmedResponse.IAadressidArrayType>(Reader, ">>>EN_EhitiseAndmed_response>aadressid_array>aadressid", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                        ENEhitiseAndmedResponse.IAadressidArrayType item = metaAadressidArray.NewEntity<ENEhitiseAndmedResponse.IAadressidArrayType>();
                        clazz.AadressidArray.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("aadressid");
                            metaAadressidArray.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>aadressid_array", Reader.LocalName);
            }
            if (Reader.LocalName=="katastriyksused_array") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>katastriyksused_array");
                }
                clazz.KatastriyksusedArray = new System.Collections.Generic.List<ENEhitiseAndmedResponse.IKatastriyksusedArrayType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("katastriyksused_array");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "katastriyksused")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>katastriyksused_array>katastriyksused");
                        }
                        global::Xtee.Core.SerializationMetadata metaKatastriyksusedArray = this.GetMetaData<ENEhitiseAndmedResponse.IKatastriyksusedArrayType>(Reader, ">>>EN_EhitiseAndmed_response>katastriyksused_array>katastriyksused", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                        ENEhitiseAndmedResponse.IKatastriyksusedArrayType item = metaKatastriyksusedArray.NewEntity<ENEhitiseAndmedResponse.IKatastriyksusedArrayType>();
                        clazz.KatastriyksusedArray.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("katastriyksused");
                            metaKatastriyksusedArray.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>katastriyksused_array", Reader.LocalName);
            }
            if (Reader.LocalName=="ehitis_katastriyksus_array") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>ehitis_katastriyksus_array");
                }
                clazz.EhitisKatastriyksusArray = new System.Collections.Generic.List<ENEhitiseAndmedResponse.IEhitisKatastriyksusArrayType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("ehitis_katastriyksus_array");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "ehitis_katastriyksus")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitis_katastriyksus_array>ehitis_katastriyksus");
                        }
                        global::Xtee.Core.SerializationMetadata metaEhitisKatastriyksusArray = this.GetMetaData<ENEhitiseAndmedResponse.IEhitisKatastriyksusArrayType>(Reader, ">>>EN_EhitiseAndmed_response>ehitis_katastriyksus_array>ehitis_katastriyksus", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                        ENEhitiseAndmedResponse.IEhitisKatastriyksusArrayType item = metaEhitisKatastriyksusArray.NewEntity<ENEhitiseAndmedResponse.IEhitisKatastriyksusArrayType>();
                        clazz.EhitisKatastriyksusArray.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("ehitis_katastriyksus");
                            metaEhitisKatastriyksusArray.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>ehitis_katastriyksus_array", Reader.LocalName);
            }
            if (Reader.LocalName=="tehnilised_naitajad_array") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>tehnilised_naitajad_array");
                }
                clazz.TehnilisedNaitajadArray = new System.Collections.Generic.List<ENEhitiseAndmedResponse.ITehnilisedNaitajadArrayType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("tehnilised_naitajad_array");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "tehnilised_naitajad")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>tehnilised_naitajad_array>tehnilised_naitajad");
                        }
                        global::Xtee.Core.SerializationMetadata metaTehnilisedNaitajadArray = this.GetMetaData<ENEhitiseAndmedResponse.ITehnilisedNaitajadArrayType>(Reader, ">>>EN_EhitiseAndmed_response>tehnilised_naitajad_array>tehnilised_naitajad", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                        ENEhitiseAndmedResponse.ITehnilisedNaitajadArrayType item = metaTehnilisedNaitajadArray.NewEntity<ENEhitiseAndmedResponse.ITehnilisedNaitajadArrayType>();
                        clazz.TehnilisedNaitajadArray.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("tehnilised_naitajad");
                            metaTehnilisedNaitajadArray.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>tehnilised_naitajad_array", Reader.LocalName);
            }
            if (Reader.LocalName=="vallasomandid_array") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>vallasomandid_array");
                }
                clazz.VallasomandidArray = new System.Collections.Generic.List<ENEhitiseAndmedResponse.IVallasomandidArrayType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("vallasomandid_array");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "vallasomandid")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid");
                        }
                        global::Xtee.Core.SerializationMetadata metaVallasomandidArray = this.GetMetaData<ENEhitiseAndmedResponse.IVallasomandidArrayType>(Reader, ">>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                        ENEhitiseAndmedResponse.IVallasomandidArrayType item = metaVallasomandidArray.NewEntity<ENEhitiseAndmedResponse.IVallasomandidArrayType>();
                        clazz.VallasomandidArray.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("vallasomandid");
                            metaVallasomandidArray.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>vallasomandid_array", Reader.LocalName);
            }
            if (Reader.LocalName=="vallasomandid_reg_kood") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>vallasomandid_reg_kood");
                }
                clazz.VallasomandidRegKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("vallasomandid_reg_kood")).Value;
            }
            if (Reader.LocalName=="ehitise_osad_array") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>ehitise_osad_array");
                }
                clazz.EhitiseOsadArray = new System.Collections.Generic.List<ENEhitiseAndmedResponse.IEhitiseOsadArrayType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("ehitise_osad_array");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "ehitise_osad")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad");
                        }
                        global::Xtee.Core.SerializationMetadata metaEhitiseOsadArray = this.GetMetaData<ENEhitiseAndmedResponse.IEhitiseOsadArrayType>(Reader, ">>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                        ENEhitiseAndmedResponse.IEhitiseOsadArrayType item = metaEhitiseOsadArray.NewEntity<ENEhitiseAndmedResponse.IEhitiseOsadArrayType>();
                        clazz.EhitiseOsadArray.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("ehitise_osad");
                            metaEhitiseOsadArray.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>ehitise_osad_array", Reader.LocalName);
            }
            if (Reader.LocalName=="ehitise_osa_tehn_naitajad_array") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>ehitise_osa_tehn_naitajad_array");
                }
                clazz.EhitiseOsaTehnNaitajadArray = new System.Collections.Generic.List<ENEhitiseAndmedResponse.IEhitiseOsaTehnNaitajadArrayType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("ehitise_osa_tehn_naitajad_array");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "ehitise_osa_tehn_naitajad")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitise_osa_tehn_naitajad_array>ehitise_osa_tehn_nai" +
                                    "tajad");
                        }
                        global::Xtee.Core.SerializationMetadata metaEhitiseOsaTehnNaitajadArray = this.GetMetaData<ENEhitiseAndmedResponse.IEhitiseOsaTehnNaitajadArrayType>(Reader, ">>>EN_EhitiseAndmed_response>ehitise_osa_tehn_naitajad_array>ehitise_osa_tehn_nai" +
                                "tajad", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                        ENEhitiseAndmedResponse.IEhitiseOsaTehnNaitajadArrayType item = metaEhitiseOsaTehnNaitajadArray.NewEntity<ENEhitiseAndmedResponse.IEhitiseOsaTehnNaitajadArrayType>();
                        clazz.EhitiseOsaTehnNaitajadArray.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("ehitise_osa_tehn_naitajad");
                            metaEhitiseOsaTehnNaitajadArray.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>ehitise_osa_tehn_naitajad_array", Reader.LocalName);
            }
            if (Reader.LocalName=="ehitis_kasutamisotstarve_array") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>ehitis_kasutamisotstarve_array");
                }
                clazz.EhitisKasutamisotstarveArray = new System.Collections.Generic.List<ENEhitiseAndmedResponse.IEhitisKasutamisotstarveArrayType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("ehitis_kasutamisotstarve_array");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "ehitis_kasutamisotstarve")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitis_kasutamisotstarve_array>ehitis_kasutamisotsta" +
                                    "rve");
                        }
                        global::Xtee.Core.SerializationMetadata metaEhitisKasutamisotstarveArray = this.GetMetaData<ENEhitiseAndmedResponse.IEhitisKasutamisotstarveArrayType>(Reader, ">>>EN_EhitiseAndmed_response>ehitis_kasutamisotstarve_array>ehitis_kasutamisotsta" +
                                "rve", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                        ENEhitiseAndmedResponse.IEhitisKasutamisotstarveArrayType item = metaEhitisKasutamisotstarveArray.NewEntity<ENEhitiseAndmedResponse.IEhitisKasutamisotstarveArrayType>();
                        clazz.EhitisKasutamisotstarveArray.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("ehitis_kasutamisotstarve");
                            metaEhitisKasutamisotstarveArray.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>ehitis_kasutamisotstarve_array", Reader.LocalName);
            }
            if (Reader.LocalName=="arestid_keelud_array") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>arestid_keelud_array");
                }
                clazz.ArestidKeeludArray = new System.Collections.Generic.List<ENEhitiseAndmedResponse.IArestidKeeludArrayType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("arestid_keelud_array");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "arestid_keelud")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud");
                        }
                        global::Xtee.Core.SerializationMetadata metaArestidKeeludArray = this.GetMetaData<ENEhitiseAndmedResponse.IArestidKeeludArrayType>(Reader, ">>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                        ENEhitiseAndmedResponse.IArestidKeeludArrayType item = metaArestidKeeludArray.NewEntity<ENEhitiseAndmedResponse.IArestidKeeludArrayType>();
                        clazz.ArestidKeeludArray.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("arestid_keelud");
                            metaArestidKeeludArray.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>arestid_keelud_array", Reader.LocalName);
            }
            if (Reader.LocalName=="omaniku_piirangud_array") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>omaniku_piirangud_array");
                }
                clazz.OmanikuPiirangudArray = new System.Collections.Generic.List<ENEhitiseAndmedResponse.IOmanikuPiirangudArrayType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("omaniku_piirangud_array");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "omaniku_piirangud")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>omaniku_piirangud_array>omaniku_piirangud");
                        }
                        global::Xtee.Core.SerializationMetadata metaOmanikuPiirangudArray = this.GetMetaData<ENEhitiseAndmedResponse.IOmanikuPiirangudArrayType>(Reader, ">>>EN_EhitiseAndmed_response>omaniku_piirangud_array>omaniku_piirangud", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                        ENEhitiseAndmedResponse.IOmanikuPiirangudArrayType item = metaOmanikuPiirangudArray.NewEntity<ENEhitiseAndmedResponse.IOmanikuPiirangudArrayType>();
                        clazz.OmanikuPiirangudArray.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("omaniku_piirangud");
                            metaOmanikuPiirangudArray.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>omaniku_piirangud_array", Reader.LocalName);
            }
            if (Reader.LocalName=="pandid_array") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>pandid_array");
                }
                clazz.PandidArray = new System.Collections.Generic.List<ENEhitiseAndmedResponse.IPandidArrayType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("pandid_array");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "pandid")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>pandid_array>pandid");
                        }
                        global::Xtee.Core.SerializationMetadata metaPandidArray = this.GetMetaData<ENEhitiseAndmedResponse.IPandidArrayType>(Reader, ">>>EN_EhitiseAndmed_response>pandid_array>pandid", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                        ENEhitiseAndmedResponse.IPandidArrayType item = metaPandidArray.NewEntity<ENEhitiseAndmedResponse.IPandidArrayType>();
                        clazz.PandidArray.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("pandid");
                            metaPandidArray.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>pandid_array", Reader.LocalName);
            }
            if (Reader.LocalName=="probleemid_array") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>probleemid_array");
                }
                clazz.ProbleemidArray = new System.Collections.Generic.List<ENEhitiseAndmedResponse.IProbleemidArrayType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("probleemid_array");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "probleemid")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>probleemid_array>probleemid");
                        }
                        global::Xtee.Core.SerializationMetadata metaProbleemidArray = this.GetMetaData<ENEhitiseAndmedResponse.IProbleemidArrayType>(Reader, ">>>EN_EhitiseAndmed_response>probleemid_array>probleemid", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                        ENEhitiseAndmedResponse.IProbleemidArrayType item = metaProbleemidArray.NewEntity<ENEhitiseAndmedResponse.IProbleemidArrayType>();
                        clazz.ProbleemidArray.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("probleemid");
                            metaProbleemidArray.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>probleemid_array", Reader.LocalName);
            }
            if (Reader.LocalName=="toalisuse_spetsid_array") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>toalisuse_spetsid_array");
                }
                clazz.ToalisuseSpetsidArray = new System.Collections.Generic.List<ENEhitiseAndmedResponse.IToalisuseSpetsidArrayType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("toalisuse_spetsid_array");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "toalisuse_spetsid")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>toalisuse_spetsid_array>toalisuse_spetsid");
                        }
                        global::Xtee.Core.SerializationMetadata metaToalisuseSpetsidArray = this.GetMetaData<ENEhitiseAndmedResponse.IToalisuseSpetsidArrayType>(Reader, ">>>EN_EhitiseAndmed_response>toalisuse_spetsid_array>toalisuse_spetsid", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                        ENEhitiseAndmedResponse.IToalisuseSpetsidArrayType item = metaToalisuseSpetsidArray.NewEntity<ENEhitiseAndmedResponse.IToalisuseSpetsidArrayType>();
                        clazz.ToalisuseSpetsidArray.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("toalisuse_spetsid");
                            metaToalisuseSpetsidArray.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>toalisuse_spetsid_array", Reader.LocalName);
            }
            if (Reader.LocalName=="kujud") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>kujud");
                }
                global::Xtee.Core.SerializationMetadata metaKujud = this.GetMetaData<ENEhitiseAndmedResponse.IKujudType>(Reader, ">>EN_EhitiseAndmed_response>kujud", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                clazz.Kujud = metaKujud.NewEntity<ENEhitiseAndmedResponse.IKujudType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("kujud");
                    metaKujud.NewSerializer(clazz.Kujud).ReadXml(Reader);
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>kujud", Reader.LocalName);
            }
            if (Reader.LocalName=="yks_kuju") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>yks_kuju");
                }
                global::Xtee.Core.SerializationMetadata metaYksKuju = this.GetMetaData<ENEhitiseAndmedResponse.IYksKujuType>(Reader, ">>EN_EhitiseAndmed_response>yks_kuju", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                clazz.YksKuju = metaYksKuju.NewEntity<ENEhitiseAndmedResponse.IYksKujuType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("yks_kuju");
                    metaYksKuju.NewSerializer(clazz.YksKuju).ReadXml(Reader);
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>yks_kuju", Reader.LocalName);
            }
            if (Reader.LocalName=="kuju_koordinaadid_array") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>kuju_koordinaadid_array");
                }
                clazz.KujuKoordinaadidArray = new System.Collections.Generic.List<ENEhitiseAndmedResponse.IKujuKoordinaadidArrayType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("kuju_koordinaadid_array");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "kuju_koordinaadid")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>kuju_koordinaadid_array>kuju_koordinaadid");
                        }
                        global::Xtee.Core.SerializationMetadata metaKujuKoordinaadidArray = this.GetMetaData<ENEhitiseAndmedResponse.IKujuKoordinaadidArrayType>(Reader, ">>>EN_EhitiseAndmed_response>kuju_koordinaadid_array>kuju_koordinaadid", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                        ENEhitiseAndmedResponse.IKujuKoordinaadidArrayType item = metaKujuKoordinaadidArray.NewEntity<ENEhitiseAndmedResponse.IKujuKoordinaadidArrayType>();
                        clazz.KujuKoordinaadidArray.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("kuju_koordinaadid");
                            metaKujuKoordinaadidArray.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>kuju_koordinaadid_array", Reader.LocalName);
            }
            if (Reader.LocalName=="anon_ehr_lingid") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>anon_ehr_lingid");
                }
                global::Xtee.Core.SerializationMetadata metaAnonEhrLingid = this.GetMetaData<ENEhitiseAndmedResponse.IAnonEhrLingidType>(Reader, ">>EN_EhitiseAndmed_response>anon_ehr_lingid", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                clazz.AnonEhrLingid = metaAnonEhrLingid.NewEntity<ENEhitiseAndmedResponse.IAnonEhrLingidType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("anon_ehr_lingid");
                    metaAnonEhrLingid.NewSerializer(clazz.AnonEhrLingid).ReadXml(Reader);
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>anon_ehr_lingid", Reader.LocalName);
            }
            if (Reader.LocalName=="kasuliku_pinna_spets_array") {
                if (Reader.IsElementNil()) {
                    throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>EN_EhitiseAndmed_response>kasuliku_pinna_spets_array");
                }
                clazz.KasulikuPinnaSpetsArray = new System.Collections.Generic.List<ENEhitiseAndmedResponse.IKasulikuPinnaSpetsArrayType>();
                if ((Reader.IsEmptyElement == false)) {
                    Reader.ReadStartElement("kasuliku_pinna_spets_array");
                    for (; ((Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
                                && (Reader.LocalName == "kasuliku_pinna_spets")); ) {
                        if (Reader.IsElementNil()) {
                            throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>kasuliku_pinna_spets_array>kasuliku_pinna_spets");
                        }
                        global::Xtee.Core.SerializationMetadata metaKasulikuPinnaSpetsArray = this.GetMetaData<ENEhitiseAndmedResponse.IKasulikuPinnaSpetsArrayType>(Reader, ">>>EN_EhitiseAndmed_response>kasuliku_pinna_spets_array>kasuliku_pinna_spets", "http://producers.ehr.xtee.riik.ee/producer/ehr");
                        ENEhitiseAndmedResponse.IKasulikuPinnaSpetsArrayType item = metaKasulikuPinnaSpetsArray.NewEntity<ENEhitiseAndmedResponse.IKasulikuPinnaSpetsArrayType>();
                        clazz.KasulikuPinnaSpetsArray.Add(item);
                        if ((Reader.IsEmptyElement == false)) {
                            Reader.ReadStartElement("kasuliku_pinna_spets");
                            metaKasulikuPinnaSpetsArray.NewSerializer(item).ReadXml(Reader);
                            Reader.ReadEndElement();
                        }
                        else {
                            Reader.Skip();
                        }
                    }
                    Reader.ReadEndElement();
                }
                else {
                    Reader.Skip();
                }
            }
            else {
                throw new global::Xtee.Core.Exceptions.UnExpectedElementException(">>EN_EhitiseAndmed_response>kasuliku_pinna_spets_array", Reader.LocalName);
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>EN_EhitiseAndmed_response>ehitised", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.EhitisedType))]
        public class EhitisedTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.IEhitisedType clazz;
            
            public EhitisedTypeSerializer(ENEhitiseAndmedResponse.IEhitisedType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.EhitisedId!=null) {
                    Writer.WriteStartElement("ehitised_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.EhitisedId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedEhrKood!=null) {
                    Writer.WriteStartElement("ehitised_ehr_kood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedEhrKood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedPosToimikus!=null) {
                    Writer.WriteStartElement("ehitised_pos_toimikus");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedPosToimikus))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedHrtKood!=null) {
                    Writer.WriteStartElement("ehitised_hrt_kood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedHrtKood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedRajatisHoone!=null) {
                    Writer.WriteStartElement("ehitised_rajatis_hoone");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedRajatisHoone))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedNimetus!=null) {
                    Writer.WriteStartElement("ehitised_nimetus");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedNimetus))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedKiliKood!=null) {
                    Writer.WriteStartElement("ehitised_kili_kood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedKiliKood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedKiliKoodTxt!=null) {
                    Writer.WriteStartElement("ehitised_kili_kood_txt");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedKiliKoodTxt))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedMontAste!=null) {
                    Writer.WriteStartElement("ehitised_mont_aste");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedMontAste))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedMinKorrusteArv!=null) {
                    Writer.WriteStartElement("ehitised_min_korruste_arv");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedMinKorrusteArv))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedMaxKorrusteArv!=null) {
                    Writer.WriteStartElement("ehitised_max_korruste_arv");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedMaxKorrusteArv))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedMaht!=null) {
                    Writer.WriteStartElement("ehitised_maht");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedMaht))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedLift!=null) {
                    Writer.WriteStartElement("ehitised_lift");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedLift))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedEhitisalunePind!=null) {
                    Writer.WriteStartElement("ehitised_ehitisalune_pind");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedEhitisalunePind))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedSuletudNetopind!=null) {
                    Writer.WriteStartElement("ehitised_suletud_netopind");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedSuletudNetopind))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedKasulikPind!=null) {
                    Writer.WriteStartElement("ehitised_kasulik_pind");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedKasulikPind))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedEsmaneKasutus!=null) {
                    Writer.WriteStartElement("ehitised_esmane_kasutus");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedEsmaneKasutus))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedKorteriteArv!=null) {
                    Writer.WriteStartElement("ehitised_korterite_arv");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedKorteriteArv))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedMitteeluruumidePind!=null) {
                    Writer.WriteStartElement("ehitised_mitteeluruumide_pind");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedMitteeluruumidePind))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedTubadeArv!=null) {
                    Writer.WriteStartElement("ehitised_tubade_arv");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.EhitisedTubadeArv))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedElamispind!=null) {
                    Writer.WriteStartElement("ehitised_elamispind");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedElamispind))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedEluruumiPind!=null) {
                    Writer.WriteStartElement("ehitised_eluruumi_pind");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedEluruumiPind))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedSoeVesi!=null) {
                    Writer.WriteStartElement("ehitised_soe_vesi");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedSoeVesi))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedEhitusregNr!=null) {
                    Writer.WriteStartElement("ehitised_ehitusreg_nr");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedEhitusregNr))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedInventKp!=null) {
                    Writer.WriteStartElement("ehitised_invent_kp");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedInventKp))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedMaaol!=null) {
                    Writer.WriteStartElement("ehitised_maaol");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedMaaol))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedMarkused!=null) {
                    Writer.WriteStartElement("ehitised_markused");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedMarkused))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedDateCreated!=null) {
                    Writer.WriteStartElement("ehitised_date_created");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedDateCreated))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedStaatus!=null) {
                    Writer.WriteStartElement("ehitised_staatus");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedStaatus))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedStaatusTxt!=null) {
                    Writer.WriteStartElement("ehitised_staatus_txt");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedStaatusTxt))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedOmandiParitolu!=null) {
                    Writer.WriteStartElement("ehitised_omandi_paritolu");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedOmandiParitolu))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedOmandiDokuTyyp!=null) {
                    Writer.WriteStartElement("ehitised_omandi_doku_tyyp");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedOmandiDokuTyyp))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedOmandiDokuId!=null) {
                    Writer.WriteStartElement("ehitised_omandi_doku_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedOmandiDokuId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedToimId!=null) {
                    Writer.WriteStartElement("ehitised_toim_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedToimId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedMitteeluruumideArv!=null) {
                    Writer.WriteStartElement("ehitised_mitteeluruumide_arv");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedMitteeluruumideArv))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedKinavald!=null) {
                    Writer.WriteStartElement("ehitised_kinavald");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedKinavald))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="ehitised_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_id");
                    }
                    clazz.EhitisedId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ehitised_id")).Value;
                }
                if (Reader.LocalName=="ehitised_ehr_kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_ehr_kood");
                    }
                    clazz.EhitisedEhrKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_ehr_kood")).Value;
                }
                if (Reader.LocalName=="ehitised_pos_toimikus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_pos_toimikus");
                    }
                    clazz.EhitisedPosToimikus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_pos_toimikus")).Value;
                }
                if (Reader.LocalName=="ehitised_hrt_kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_hrt_kood");
                    }
                    clazz.EhitisedHrtKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_hrt_kood")).Value;
                }
                if (Reader.LocalName=="ehitised_rajatis_hoone") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_rajatis_hoone");
                    }
                    clazz.EhitisedRajatisHoone = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_rajatis_hoone")).Value;
                }
                if (Reader.LocalName=="ehitised_nimetus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_nimetus");
                    }
                    clazz.EhitisedNimetus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_nimetus")).Value;
                }
                if (Reader.LocalName=="ehitised_kili_kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_kili_kood");
                    }
                    clazz.EhitisedKiliKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_kili_kood")).Value;
                }
                if (Reader.LocalName=="ehitised_kili_kood_txt") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_kili_kood_txt");
                    }
                    clazz.EhitisedKiliKoodTxt = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_kili_kood_txt")).Value;
                }
                if (Reader.LocalName=="ehitised_mont_aste") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_mont_aste");
                    }
                    clazz.EhitisedMontAste = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_mont_aste")).Value;
                }
                if (Reader.LocalName=="ehitised_min_korruste_arv") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_min_korruste_arv");
                    }
                    clazz.EhitisedMinKorrusteArv = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_min_korruste_arv")).Value;
                }
                if (Reader.LocalName=="ehitised_max_korruste_arv") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_max_korruste_arv");
                    }
                    clazz.EhitisedMaxKorrusteArv = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_max_korruste_arv")).Value;
                }
                if (Reader.LocalName=="ehitised_maht") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_maht");
                    }
                    clazz.EhitisedMaht = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_maht")).Value;
                }
                if (Reader.LocalName=="ehitised_lift") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_lift");
                    }
                    clazz.EhitisedLift = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_lift")).Value;
                }
                if (Reader.LocalName=="ehitised_ehitisalune_pind") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_ehitisalune_pind");
                    }
                    clazz.EhitisedEhitisalunePind = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_ehitisalune_pind")).Value;
                }
                if (Reader.LocalName=="ehitised_suletud_netopind") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_suletud_netopind");
                    }
                    clazz.EhitisedSuletudNetopind = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_suletud_netopind")).Value;
                }
                if (Reader.LocalName=="ehitised_kasulik_pind") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_kasulik_pind");
                    }
                    clazz.EhitisedKasulikPind = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_kasulik_pind")).Value;
                }
                if (Reader.LocalName=="ehitised_esmane_kasutus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_esmane_kasutus");
                    }
                    clazz.EhitisedEsmaneKasutus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_esmane_kasutus")).Value;
                }
                if (Reader.LocalName=="ehitised_korterite_arv") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_korterite_arv");
                    }
                    clazz.EhitisedKorteriteArv = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_korterite_arv")).Value;
                }
                if (Reader.LocalName=="ehitised_mitteeluruumide_pind") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_mitteeluruumide_pind");
                    }
                    clazz.EhitisedMitteeluruumidePind = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_mitteeluruumide_pind")).Value;
                }
                if (Reader.LocalName=="ehitised_tubade_arv") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_tubade_arv");
                    }
                    clazz.EhitisedTubadeArv = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ehitised_tubade_arv")).Value;
                }
                if (Reader.LocalName=="ehitised_elamispind") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_elamispind");
                    }
                    clazz.EhitisedElamispind = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_elamispind")).Value;
                }
                if (Reader.LocalName=="ehitised_eluruumi_pind") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_eluruumi_pind");
                    }
                    clazz.EhitisedEluruumiPind = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_eluruumi_pind")).Value;
                }
                if (Reader.LocalName=="ehitised_soe_vesi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_soe_vesi");
                    }
                    clazz.EhitisedSoeVesi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_soe_vesi")).Value;
                }
                if (Reader.LocalName=="ehitised_ehitusreg_nr") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_ehitusreg_nr");
                    }
                    clazz.EhitisedEhitusregNr = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_ehitusreg_nr")).Value;
                }
                if (Reader.LocalName=="ehitised_invent_kp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_invent_kp");
                    }
                    clazz.EhitisedInventKp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_invent_kp")).Value;
                }
                if (Reader.LocalName=="ehitised_maaol") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_maaol");
                    }
                    clazz.EhitisedMaaol = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_maaol")).Value;
                }
                if (Reader.LocalName=="ehitised_markused") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_markused");
                    }
                    clazz.EhitisedMarkused = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_markused")).Value;
                }
                if (Reader.LocalName=="ehitised_date_created") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_date_created");
                    }
                    clazz.EhitisedDateCreated = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_date_created")).Value;
                }
                if (Reader.LocalName=="ehitised_staatus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_staatus");
                    }
                    clazz.EhitisedStaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_staatus")).Value;
                }
                if (Reader.LocalName=="ehitised_staatus_txt") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_staatus_txt");
                    }
                    clazz.EhitisedStaatusTxt = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_staatus_txt")).Value;
                }
                if (Reader.LocalName=="ehitised_omandi_paritolu") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_omandi_paritolu");
                    }
                    clazz.EhitisedOmandiParitolu = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_omandi_paritolu")).Value;
                }
                if (Reader.LocalName=="ehitised_omandi_doku_tyyp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_omandi_doku_tyyp");
                    }
                    clazz.EhitisedOmandiDokuTyyp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_omandi_doku_tyyp")).Value;
                }
                if (Reader.LocalName=="ehitised_omandi_doku_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_omandi_doku_id");
                    }
                    clazz.EhitisedOmandiDokuId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_omandi_doku_id")).Value;
                }
                if (Reader.LocalName=="ehitised_toim_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_toim_id");
                    }
                    clazz.EhitisedToimId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_toim_id")).Value;
                }
                if (Reader.LocalName=="ehitised_mitteeluruumide_arv") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_mitteeluruumide_arv");
                    }
                    clazz.EhitisedMitteeluruumideArv = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_mitteeluruumide_arv")).Value;
                }
                if (Reader.LocalName=="ehitised_kinavald") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised>ehitised_kinavald");
                    }
                    clazz.EhitisedKinavald = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_kinavald")).Value;
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>EN_EhitiseAndmed_response>ehitised_lisa", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.EhitisedLisaType))]
        public class EhitisedLisaTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.IEhitisedLisaType clazz;
            
            public EhitisedLisaTypeSerializer(ENEhitiseAndmedResponse.IEhitisedLisaType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.EhitisedLisaEhitId!=null) {
                    Writer.WriteStartElement("ehitised_lisa_ehit_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.EhitisedLisaEhitId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedLisaEnergiaklass!=null) {
                    Writer.WriteStartElement("ehitised_lisa_energiaklass");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.EhitisedLisaEnergiaklass))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedLisaEnergiaklassTxt!=null) {
                    Writer.WriteStartElement("ehitised_lisa_energiaklass_txt");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedLisaEnergiaklassTxt))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedLisaMargiseKp!=null) {
                    Writer.WriteStartElement("ehitised_lisa_margise_kp");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedLisaMargiseKp))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedLisaInfoAllikad!=null) {
                    Writer.WriteStartElement("ehitised_lisa_info_allikad");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.EhitisedLisaInfoAllikad))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisedLisaDateCreated!=null) {
                    Writer.WriteStartElement("ehitised_lisa_date_created");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisedLisaDateCreated))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="ehitised_lisa_ehit_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised_lisa>ehitised_lisa_ehit_id");
                    }
                    clazz.EhitisedLisaEhitId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ehitised_lisa_ehit_id")).Value;
                }
                if (Reader.LocalName=="ehitised_lisa_energiaklass") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised_lisa>ehitised_lisa_energiaklass");
                    }
                    clazz.EhitisedLisaEnergiaklass = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ehitised_lisa_energiaklass")).Value;
                }
                if (Reader.LocalName=="ehitised_lisa_energiaklass_txt") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised_lisa>ehitised_lisa_energiaklass_txt");
                    }
                    clazz.EhitisedLisaEnergiaklassTxt = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_lisa_energiaklass_txt")).Value;
                }
                if (Reader.LocalName=="ehitised_lisa_margise_kp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised_lisa>ehitised_lisa_margise_kp");
                    }
                    clazz.EhitisedLisaMargiseKp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_lisa_margise_kp")).Value;
                }
                if (Reader.LocalName=="ehitised_lisa_info_allikad") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised_lisa>ehitised_lisa_info_allikad");
                    }
                    clazz.EhitisedLisaInfoAllikad = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ehitised_lisa_info_allikad")).Value;
                }
                if (Reader.LocalName=="ehitised_lisa_date_created") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>ehitised_lisa>ehitised_lisa_date_created");
                    }
                    clazz.EhitisedLisaDateCreated = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitised_lisa_date_created")).Value;
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>EN_EhitiseAndmed_response>aadressid_array>aadressid", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.AadressidArrayType))]
        public class AadressidArrayTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.IAadressidArrayType clazz;
            
            public AadressidArrayTypeSerializer(ENEhitiseAndmedResponse.IAadressidArrayType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.AadressidAadrId!=null) {
                    Writer.WriteStartElement("aadressid_aadr_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.AadressidAadrId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.AadressidEhitId!=null) {
                    Writer.WriteStartElement("aadressid_ehit_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.AadressidEhitId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.AadressidAsukoht!=null) {
                    Writer.WriteStartElement("aadressid_asukoht");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.AadressidAsukoht))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.AadressidTanavMaja!=null) {
                    Writer.WriteStartElement("aadressid_tanav_maja");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.AadressidTanavMaja))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.AadressidAadressTekstina!=null) {
                    Writer.WriteStartElement("aadressid_aadress_tekstina");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.AadressidAadressTekstina))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.AadressidMaakond!=null) {
                    Writer.WriteStartElement("aadressid_maakond");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.AadressidMaakond))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.AadressidOmavalitsus!=null) {
                    Writer.WriteStartElement("aadressid_omavalitsus");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.AadressidOmavalitsus))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.AadressidKyla!=null) {
                    Writer.WriteStartElement("aadressid_kyla");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.AadressidKyla))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.AadressidDateCreated!=null) {
                    Writer.WriteStartElement("aadressid_date_created");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.AadressidDateCreated))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.AadressidTanav!=null) {
                    Writer.WriteStartElement("aadressid_tanav");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.AadressidTanav))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.AadressidMaja!=null) {
                    Writer.WriteStartElement("aadressid_maja");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.AadressidMaja))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="aadressid_aadr_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>aadressid_array>aadressid>aadressid_aadr_id");
                    }
                    clazz.AadressidAadrId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("aadressid_aadr_id")).Value;
                }
                if (Reader.LocalName=="aadressid_ehit_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>aadressid_array>aadressid>aadressid_ehit_id");
                    }
                    clazz.AadressidEhitId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("aadressid_ehit_id")).Value;
                }
                if (Reader.LocalName=="aadressid_asukoht") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>aadressid_array>aadressid>aadressid_asukoht");
                    }
                    clazz.AadressidAsukoht = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("aadressid_asukoht")).Value;
                }
                if (Reader.LocalName=="aadressid_tanav_maja") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>aadressid_array>aadressid>aadressid_tanav_maja");
                    }
                    clazz.AadressidTanavMaja = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("aadressid_tanav_maja")).Value;
                }
                if (Reader.LocalName=="aadressid_aadress_tekstina") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>aadressid_array>aadressid>aadressid_aadress_tekstin" +
                                "a");
                    }
                    clazz.AadressidAadressTekstina = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("aadressid_aadress_tekstina")).Value;
                }
                if (Reader.LocalName=="aadressid_maakond") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>aadressid_array>aadressid>aadressid_maakond");
                    }
                    clazz.AadressidMaakond = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("aadressid_maakond")).Value;
                }
                if (Reader.LocalName=="aadressid_omavalitsus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>aadressid_array>aadressid>aadressid_omavalitsus");
                    }
                    clazz.AadressidOmavalitsus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("aadressid_omavalitsus")).Value;
                }
                if (Reader.LocalName=="aadressid_kyla") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>aadressid_array>aadressid>aadressid_kyla");
                    }
                    clazz.AadressidKyla = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("aadressid_kyla")).Value;
                }
                if (Reader.LocalName=="aadressid_date_created") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>aadressid_array>aadressid>aadressid_date_created");
                    }
                    clazz.AadressidDateCreated = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("aadressid_date_created")).Value;
                }
                if (Reader.LocalName=="aadressid_tanav") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>aadressid_array>aadressid>aadressid_tanav");
                    }
                    clazz.AadressidTanav = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("aadressid_tanav")).Value;
                }
                if (Reader.LocalName=="aadressid_maja") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>aadressid_array>aadressid>aadressid_maja");
                    }
                    clazz.AadressidMaja = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("aadressid_maja")).Value;
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>EN_EhitiseAndmed_response>katastriyksused_array>katastriyksused", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.KatastriyksusedArrayType))]
        public class KatastriyksusedArrayTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.IKatastriyksusedArrayType clazz;
            
            public KatastriyksusedArrayTypeSerializer(ENEhitiseAndmedResponse.IKatastriyksusedArrayType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.KatastriyksusedId!=null) {
                    Writer.WriteStartElement("katastriyksused_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.KatastriyksusedId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.KatastriyksusedKatastritunnus!=null) {
                    Writer.WriteStartElement("katastriyksused_katastritunnus");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KatastriyksusedKatastritunnus))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.KatastriyksusedRegKp!=null) {
                    Writer.WriteStartElement("katastriyksused_reg_kp");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KatastriyksusedRegKp))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="katastriyksused_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>katastriyksused_array>katastriyksused>katastriyksus" +
                                "ed_id");
                    }
                    clazz.KatastriyksusedId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("katastriyksused_id")).Value;
                }
                if (Reader.LocalName=="katastriyksused_katastritunnus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>katastriyksused_array>katastriyksused>katastriyksus" +
                                "ed_katastritunnus");
                    }
                    clazz.KatastriyksusedKatastritunnus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("katastriyksused_katastritunnus")).Value;
                }
                if (Reader.LocalName=="katastriyksused_reg_kp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>katastriyksused_array>katastriyksused>katastriyksus" +
                                "ed_reg_kp");
                    }
                    clazz.KatastriyksusedRegKp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("katastriyksused_reg_kp")).Value;
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>EN_EhitiseAndmed_response>ehitis_katastriyksus_array>ehitis_katastriyksus", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.EhitisKatastriyksusArrayType))]
        public class EhitisKatastriyksusArrayTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.IEhitisKatastriyksusArrayType clazz;
            
            public EhitisKatastriyksusArrayTypeSerializer(ENEhitiseAndmedResponse.IEhitisKatastriyksusArrayType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.EhitisKatastriyksusId!=null) {
                    Writer.WriteStartElement("ehitis_katastriyksus_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.EhitisKatastriyksusId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisKatastriyksusKaykId!=null) {
                    Writer.WriteStartElement("ehitis_katastriyksus_kayk_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.EhitisKatastriyksusKaykId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisKatastriyksusEhrKood!=null) {
                    Writer.WriteStartElement("ehitis_katastriyksus_ehr_kood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisKatastriyksusEhrKood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisKatastriyksusKatastritunnus!=null) {
                    Writer.WriteStartElement("ehitis_katastriyksus_katastritunnus");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisKatastriyksusKatastritunnus))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisKatastriyksusRegKp!=null) {
                    Writer.WriteStartElement("ehitis_katastriyksus_reg_kp");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisKatastriyksusRegKp))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisKatastriyksusEhitId!=null) {
                    Writer.WriteStartElement("ehitis_katastriyksus_ehit_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisKatastriyksusEhitId))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="ehitis_katastriyksus_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitis_katastriyksus_array>ehitis_katastriyksus>ehi" +
                                "tis_katastriyksus_id");
                    }
                    clazz.EhitisKatastriyksusId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ehitis_katastriyksus_id")).Value;
                }
                if (Reader.LocalName=="ehitis_katastriyksus_kayk_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitis_katastriyksus_array>ehitis_katastriyksus>ehi" +
                                "tis_katastriyksus_kayk_id");
                    }
                    clazz.EhitisKatastriyksusKaykId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ehitis_katastriyksus_kayk_id")).Value;
                }
                if (Reader.LocalName=="ehitis_katastriyksus_ehr_kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitis_katastriyksus_array>ehitis_katastriyksus>ehi" +
                                "tis_katastriyksus_ehr_kood");
                    }
                    clazz.EhitisKatastriyksusEhrKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitis_katastriyksus_ehr_kood")).Value;
                }
                if (Reader.LocalName=="ehitis_katastriyksus_katastritunnus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitis_katastriyksus_array>ehitis_katastriyksus>ehi" +
                                "tis_katastriyksus_katastritunnus");
                    }
                    clazz.EhitisKatastriyksusKatastritunnus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitis_katastriyksus_katastritunnus")).Value;
                }
                if (Reader.LocalName=="ehitis_katastriyksus_reg_kp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitis_katastriyksus_array>ehitis_katastriyksus>ehi" +
                                "tis_katastriyksus_reg_kp");
                    }
                    clazz.EhitisKatastriyksusRegKp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitis_katastriyksus_reg_kp")).Value;
                }
                if (Reader.LocalName=="ehitis_katastriyksus_ehit_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitis_katastriyksus_array>ehitis_katastriyksus>ehi" +
                                "tis_katastriyksus_ehit_id");
                    }
                    clazz.EhitisKatastriyksusEhitId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitis_katastriyksus_ehit_id")).Value;
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>EN_EhitiseAndmed_response>tehnilised_naitajad_array>tehnilised_naitajad", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.TehnilisedNaitajadArrayType))]
        public class TehnilisedNaitajadArrayTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.ITehnilisedNaitajadArrayType clazz;
            
            public TehnilisedNaitajadArrayTypeSerializer(ENEhitiseAndmedResponse.ITehnilisedNaitajadArrayType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.TehnilisedNaitajadId!=null) {
                    Writer.WriteStartElement("tehnilised_naitajad_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.TehnilisedNaitajadId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TehnilisedNaitajadEhitId!=null) {
                    Writer.WriteStartElement("tehnilised_naitajad_ehit_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.TehnilisedNaitajadEhitId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TehnilisedNaitajadKltyNkood!=null) {
                    Writer.WriteStartElement("tehnilised_naitajad_klty_nkood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TehnilisedNaitajadKltyNkood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TehnilisedNaitajadTenaKood!=null) {
                    Writer.WriteStartElement("tehnilised_naitajad_tena_kood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TehnilisedNaitajadTenaKood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TehnilisedNaitajadTehnNaitNimetus!=null) {
                    Writer.WriteStartElement("tehnilised_naitajad_tehn_nait_nimetus");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TehnilisedNaitajadTehnNaitNimetus))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TehnilisedNaitajadJrkNr!=null) {
                    Writer.WriteStartElement("tehnilised_naitajad_jrk_nr");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TehnilisedNaitajadJrkNr))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TehnilisedNaitajadLisavaartus!=null) {
                    Writer.WriteStartElement("tehnilised_naitajad_lisavaartus");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TehnilisedNaitajadLisavaartus))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TehnilisedNaitajadSeotud!=null) {
                    Writer.WriteStartElement("tehnilised_naitajad_seotud");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TehnilisedNaitajadSeotud))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.TehnilisedNaitajadDateCreated!=null) {
                    Writer.WriteStartElement("tehnilised_naitajad_date_created");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.TehnilisedNaitajadDateCreated))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="tehnilised_naitajad_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>tehnilised_naitajad_array>tehnilised_naitajad>tehni" +
                                "lised_naitajad_id");
                    }
                    clazz.TehnilisedNaitajadId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("tehnilised_naitajad_id")).Value;
                }
                if (Reader.LocalName=="tehnilised_naitajad_ehit_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>tehnilised_naitajad_array>tehnilised_naitajad>tehni" +
                                "lised_naitajad_ehit_id");
                    }
                    clazz.TehnilisedNaitajadEhitId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("tehnilised_naitajad_ehit_id")).Value;
                }
                if (Reader.LocalName=="tehnilised_naitajad_klty_nkood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>tehnilised_naitajad_array>tehnilised_naitajad>tehni" +
                                "lised_naitajad_klty_nkood");
                    }
                    clazz.TehnilisedNaitajadKltyNkood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("tehnilised_naitajad_klty_nkood")).Value;
                }
                if (Reader.LocalName=="tehnilised_naitajad_tena_kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>tehnilised_naitajad_array>tehnilised_naitajad>tehni" +
                                "lised_naitajad_tena_kood");
                    }
                    clazz.TehnilisedNaitajadTenaKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("tehnilised_naitajad_tena_kood")).Value;
                }
                if (Reader.LocalName=="tehnilised_naitajad_tehn_nait_nimetus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>tehnilised_naitajad_array>tehnilised_naitajad>tehni" +
                                "lised_naitajad_tehn_nait_nimetus");
                    }
                    clazz.TehnilisedNaitajadTehnNaitNimetus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("tehnilised_naitajad_tehn_nait_nimetus")).Value;
                }
                if (Reader.LocalName=="tehnilised_naitajad_jrk_nr") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>tehnilised_naitajad_array>tehnilised_naitajad>tehni" +
                                "lised_naitajad_jrk_nr");
                    }
                    clazz.TehnilisedNaitajadJrkNr = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("tehnilised_naitajad_jrk_nr")).Value;
                }
                if (Reader.LocalName=="tehnilised_naitajad_lisavaartus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>tehnilised_naitajad_array>tehnilised_naitajad>tehni" +
                                "lised_naitajad_lisavaartus");
                    }
                    clazz.TehnilisedNaitajadLisavaartus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("tehnilised_naitajad_lisavaartus")).Value;
                }
                if (Reader.LocalName=="tehnilised_naitajad_seotud") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>tehnilised_naitajad_array>tehnilised_naitajad>tehni" +
                                "lised_naitajad_seotud");
                    }
                    clazz.TehnilisedNaitajadSeotud = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("tehnilised_naitajad_seotud")).Value;
                }
                if (Reader.LocalName=="tehnilised_naitajad_date_created") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>tehnilised_naitajad_array>tehnilised_naitajad>tehni" +
                                "lised_naitajad_date_created");
                    }
                    clazz.TehnilisedNaitajadDateCreated = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("tehnilised_naitajad_date_created")).Value;
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.VallasomandidArrayType))]
        public class VallasomandidArrayTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.IVallasomandidArrayType clazz;
            
            public VallasomandidArrayTypeSerializer(ENEhitiseAndmedResponse.IVallasomandidArrayType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.VallasomandidMotOsaNimetaja!=null) {
                    Writer.WriteStartElement("vallasomandid_mot_osa_nimetaja");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VallasomandidMotOsaNimetaja))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.VallasomandidId!=null) {
                    Writer.WriteStartElement("vallasomandid_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.VallasomandidId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.VallasomandidEhitId!=null) {
                    Writer.WriteStartElement("vallasomandid_ehit_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.VallasomandidEhitId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.VallasomandidYhineOmand!=null) {
                    Writer.WriteStartElement("vallasomandid_yhine_omand");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VallasomandidYhineOmand))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.VallasomandidEhosId!=null) {
                    Writer.WriteStartElement("vallasomandid_ehos_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.VallasomandidEhosId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.VallasomandidIsikId!=null) {
                    Writer.WriteStartElement("vallasomandid_isik_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.VallasomandidIsikId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.VallasomandidIsikukood!=null) {
                    Writer.WriteStartElement("vallasomandid_isikukood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VallasomandidIsikukood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.VallasomandidEesnimi!=null) {
                    Writer.WriteStartElement("vallasomandid_eesnimi");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VallasomandidEesnimi))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.VallasomandidPerenimi!=null) {
                    Writer.WriteStartElement("vallasomandid_perenimi");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VallasomandidPerenimi))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.VallasomandidSynniaeg!=null) {
                    Writer.WriteStartElement("vallasomandid_synniaeg");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VallasomandidSynniaeg))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.VallasomandidEst!=null) {
                    Writer.WriteStartElement("vallasomandid_est");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VallasomandidEst))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.VallasomandidAadrTekst!=null) {
                    Writer.WriteStartElement("vallasomandid_aadr_tekst");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VallasomandidAadrTekst))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.VallasomandidDateCreated!=null) {
                    Writer.WriteStartElement("vallasomandid_date_created");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VallasomandidDateCreated))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.VallasomandidGrupp!=null) {
                    Writer.WriteStartElement("vallasomandid_grupp");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VallasomandidGrupp))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.VallasomandidJiNimi!=null) {
                    Writer.WriteStartElement("vallasomandid_ji_nimi");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VallasomandidJiNimi))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.VallasomandidIsikuliik!=null) {
                    Writer.WriteStartElement("vallasomandid_isikuliik");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VallasomandidIsikuliik))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.VallasomandidMotOsaLugeja!=null) {
                    Writer.WriteStartElement("vallasomandid_mot_osa_lugeja");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VallasomandidMotOsaLugeja))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.VallasomandidKirjeldus!=null) {
                    Writer.WriteStartElement("vallasomandid_kirjeldus");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.VallasomandidKirjeldus))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="vallasomandid_mot_osa_nimetaja") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid>vallasomandid_mot" +
                                "_osa_nimetaja");
                    }
                    clazz.VallasomandidMotOsaNimetaja = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("vallasomandid_mot_osa_nimetaja")).Value;
                }
                if (Reader.LocalName=="vallasomandid_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid>vallasomandid_id");
                    }
                    clazz.VallasomandidId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("vallasomandid_id")).Value;
                }
                if (Reader.LocalName=="vallasomandid_ehit_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid>vallasomandid_ehi" +
                                "t_id");
                    }
                    clazz.VallasomandidEhitId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("vallasomandid_ehit_id")).Value;
                }
                if (Reader.LocalName=="vallasomandid_yhine_omand") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid>vallasomandid_yhi" +
                                "ne_omand");
                    }
                    clazz.VallasomandidYhineOmand = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("vallasomandid_yhine_omand")).Value;
                }
                if (Reader.LocalName=="vallasomandid_ehos_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid>vallasomandid_eho" +
                                "s_id");
                    }
                    clazz.VallasomandidEhosId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("vallasomandid_ehos_id")).Value;
                }
                if (Reader.LocalName=="vallasomandid_isik_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid>vallasomandid_isi" +
                                "k_id");
                    }
                    clazz.VallasomandidIsikId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("vallasomandid_isik_id")).Value;
                }
                if (Reader.LocalName=="vallasomandid_isikukood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid>vallasomandid_isi" +
                                "kukood");
                    }
                    clazz.VallasomandidIsikukood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("vallasomandid_isikukood")).Value;
                }
                if (Reader.LocalName=="vallasomandid_eesnimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid>vallasomandid_ees" +
                                "nimi");
                    }
                    clazz.VallasomandidEesnimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("vallasomandid_eesnimi")).Value;
                }
                if (Reader.LocalName=="vallasomandid_perenimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid>vallasomandid_per" +
                                "enimi");
                    }
                    clazz.VallasomandidPerenimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("vallasomandid_perenimi")).Value;
                }
                if (Reader.LocalName=="vallasomandid_synniaeg") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid>vallasomandid_syn" +
                                "niaeg");
                    }
                    clazz.VallasomandidSynniaeg = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("vallasomandid_synniaeg")).Value;
                }
                if (Reader.LocalName=="vallasomandid_est") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid>vallasomandid_est" +
                                "");
                    }
                    clazz.VallasomandidEst = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("vallasomandid_est")).Value;
                }
                if (Reader.LocalName=="vallasomandid_aadr_tekst") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid>vallasomandid_aad" +
                                "r_tekst");
                    }
                    clazz.VallasomandidAadrTekst = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("vallasomandid_aadr_tekst")).Value;
                }
                if (Reader.LocalName=="vallasomandid_date_created") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid>vallasomandid_dat" +
                                "e_created");
                    }
                    clazz.VallasomandidDateCreated = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("vallasomandid_date_created")).Value;
                }
                if (Reader.LocalName=="vallasomandid_grupp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid>vallasomandid_gru" +
                                "pp");
                    }
                    clazz.VallasomandidGrupp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("vallasomandid_grupp")).Value;
                }
                if (Reader.LocalName=="vallasomandid_ji_nimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid>vallasomandid_ji_" +
                                "nimi");
                    }
                    clazz.VallasomandidJiNimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("vallasomandid_ji_nimi")).Value;
                }
                if (Reader.LocalName=="vallasomandid_isikuliik") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid>vallasomandid_isi" +
                                "kuliik");
                    }
                    clazz.VallasomandidIsikuliik = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("vallasomandid_isikuliik")).Value;
                }
                if (Reader.LocalName=="vallasomandid_mot_osa_lugeja") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid>vallasomandid_mot" +
                                "_osa_lugeja");
                    }
                    clazz.VallasomandidMotOsaLugeja = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("vallasomandid_mot_osa_lugeja")).Value;
                }
                if (Reader.LocalName=="vallasomandid_kirjeldus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>vallasomandid_array>vallasomandid>vallasomandid_kir" +
                                "jeldus");
                    }
                    clazz.VallasomandidKirjeldus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("vallasomandid_kirjeldus")).Value;
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.EhitiseOsadArrayType))]
        public class EhitiseOsadArrayTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.IEhitiseOsadArrayType clazz;
            
            public EhitiseOsadArrayTypeSerializer(ENEhitiseAndmedResponse.IEhitiseOsadArrayType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.EhitiseOsadId!=null) {
                    Writer.WriteStartElement("ehitise_osad_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.EhitiseOsadId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsadEhitId!=null) {
                    Writer.WriteStartElement("ehitise_osad_ehit_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.EhitiseOsadEhitId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsadToliKood!=null) {
                    Writer.WriteStartElement("ehitise_osad_toli_kood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsadToliKood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsadLiik!=null) {
                    Writer.WriteStartElement("ehitise_osad_liik");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsadLiik))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsadLiikTxt!=null) {
                    Writer.WriteStartElement("ehitise_osad_liik_txt");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsadLiikTxt))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsadTahis!=null) {
                    Writer.WriteStartElement("ehitise_osad_tahis");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsadTahis))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsadSissepaasuKorrus!=null) {
                    Writer.WriteStartElement("ehitise_osad_sissepaasu_korrus");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsadSissepaasuKorrus))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsadPind!=null) {
                    Writer.WriteStartElement("ehitise_osad_pind");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsadPind))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsadElamispind!=null) {
                    Writer.WriteStartElement("ehitise_osad_elamispind");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsadElamispind))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsadLahuspind!=null) {
                    Writer.WriteStartElement("ehitise_osad_lahuspind");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsadLahuspind))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsadTualettruum!=null) {
                    Writer.WriteStartElement("ehitise_osad_tualettruum");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsadTualettruum))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsadKook!=null) {
                    Writer.WriteStartElement("ehitise_osad_kook");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsadKook))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsadReaalosaLugeja!=null) {
                    Writer.WriteStartElement("ehitise_osad_reaalosa_lugeja");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsadReaalosaLugeja))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsadReaalosaNimetaja!=null) {
                    Writer.WriteStartElement("ehitise_osad_reaalosa_nimetaja");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsadReaalosaNimetaja))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsadDateCreated!=null) {
                    Writer.WriteStartElement("ehitise_osad_date_created");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsadDateCreated))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsadStaatus!=null) {
                    Writer.WriteStartElement("ehitise_osad_staatus");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsadStaatus))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsadStaatusTxt!=null) {
                    Writer.WriteStartElement("ehitise_osad_staatus_txt");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsadStaatusTxt))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsadOmandiParitolu!=null) {
                    Writer.WriteStartElement("ehitise_osad_omandi_paritolu");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsadOmandiParitolu))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsadOmandiDokuTyyp!=null) {
                    Writer.WriteStartElement("ehitise_osad_omandi_doku_tyyp");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsadOmandiDokuTyyp))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsadOmandiDokuId!=null) {
                    Writer.WriteStartElement("ehitise_osad_omandi_doku_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsadOmandiDokuId))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="ehitise_osad_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_id");
                    }
                    clazz.EhitiseOsadId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ehitise_osad_id")).Value;
                }
                if (Reader.LocalName=="ehitise_osad_ehit_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_ehit_i" +
                                "d");
                    }
                    clazz.EhitiseOsadEhitId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ehitise_osad_ehit_id")).Value;
                }
                if (Reader.LocalName=="ehitise_osad_toli_kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_toli_k" +
                                "ood");
                    }
                    clazz.EhitiseOsadToliKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osad_toli_kood")).Value;
                }
                if (Reader.LocalName=="ehitise_osad_liik") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_liik");
                    }
                    clazz.EhitiseOsadLiik = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osad_liik")).Value;
                }
                if (Reader.LocalName=="ehitise_osad_liik_txt") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_liik_t" +
                                "xt");
                    }
                    clazz.EhitiseOsadLiikTxt = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osad_liik_txt")).Value;
                }
                if (Reader.LocalName=="ehitise_osad_tahis") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_tahis");
                    }
                    clazz.EhitiseOsadTahis = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osad_tahis")).Value;
                }
                if (Reader.LocalName=="ehitise_osad_sissepaasu_korrus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_sissep" +
                                "aasu_korrus");
                    }
                    clazz.EhitiseOsadSissepaasuKorrus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osad_sissepaasu_korrus")).Value;
                }
                if (Reader.LocalName=="ehitise_osad_pind") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_pind");
                    }
                    clazz.EhitiseOsadPind = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osad_pind")).Value;
                }
                if (Reader.LocalName=="ehitise_osad_elamispind") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_elamis" +
                                "pind");
                    }
                    clazz.EhitiseOsadElamispind = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osad_elamispind")).Value;
                }
                if (Reader.LocalName=="ehitise_osad_lahuspind") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_lahusp" +
                                "ind");
                    }
                    clazz.EhitiseOsadLahuspind = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osad_lahuspind")).Value;
                }
                if (Reader.LocalName=="ehitise_osad_tualettruum") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_tualet" +
                                "truum");
                    }
                    clazz.EhitiseOsadTualettruum = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osad_tualettruum")).Value;
                }
                if (Reader.LocalName=="ehitise_osad_kook") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_kook");
                    }
                    clazz.EhitiseOsadKook = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osad_kook")).Value;
                }
                if (Reader.LocalName=="ehitise_osad_reaalosa_lugeja") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_reaalo" +
                                "sa_lugeja");
                    }
                    clazz.EhitiseOsadReaalosaLugeja = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osad_reaalosa_lugeja")).Value;
                }
                if (Reader.LocalName=="ehitise_osad_reaalosa_nimetaja") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_reaalo" +
                                "sa_nimetaja");
                    }
                    clazz.EhitiseOsadReaalosaNimetaja = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osad_reaalosa_nimetaja")).Value;
                }
                if (Reader.LocalName=="ehitise_osad_date_created") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_date_c" +
                                "reated");
                    }
                    clazz.EhitiseOsadDateCreated = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osad_date_created")).Value;
                }
                if (Reader.LocalName=="ehitise_osad_staatus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_staatu" +
                                "s");
                    }
                    clazz.EhitiseOsadStaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osad_staatus")).Value;
                }
                if (Reader.LocalName=="ehitise_osad_staatus_txt") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_staatu" +
                                "s_txt");
                    }
                    clazz.EhitiseOsadStaatusTxt = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osad_staatus_txt")).Value;
                }
                if (Reader.LocalName=="ehitise_osad_omandi_paritolu") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_omandi" +
                                "_paritolu");
                    }
                    clazz.EhitiseOsadOmandiParitolu = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osad_omandi_paritolu")).Value;
                }
                if (Reader.LocalName=="ehitise_osad_omandi_doku_tyyp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_omandi" +
                                "_doku_tyyp");
                    }
                    clazz.EhitiseOsadOmandiDokuTyyp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osad_omandi_doku_tyyp")).Value;
                }
                if (Reader.LocalName=="ehitise_osad_omandi_doku_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osad_array>ehitise_osad>ehitise_osad_omandi" +
                                "_doku_id");
                    }
                    clazz.EhitiseOsadOmandiDokuId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osad_omandi_doku_id")).Value;
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>EN_EhitiseAndmed_response>ehitise_osa_tehn_naitajad_array>ehitise_osa_tehn_nai" +
            "tajad", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.EhitiseOsaTehnNaitajadArrayType))]
        public class EhitiseOsaTehnNaitajadArrayTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.IEhitiseOsaTehnNaitajadArrayType clazz;
            
            public EhitiseOsaTehnNaitajadArrayTypeSerializer(ENEhitiseAndmedResponse.IEhitiseOsaTehnNaitajadArrayType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.EhitiseOsaTehnNaitajadId!=null) {
                    Writer.WriteStartElement("ehitise_osa_tehn_naitajad_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.EhitiseOsaTehnNaitajadId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsaTehnNaitajadEhosId!=null) {
                    Writer.WriteStartElement("ehitise_osa_tehn_naitajad_ehos_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.EhitiseOsaTehnNaitajadEhosId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsaTehnNaitajadKltyNkood!=null) {
                    Writer.WriteStartElement("ehitise_osa_tehn_naitajad_klty_nkood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsaTehnNaitajadKltyNkood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsaTehnNaitajadTenaKood!=null) {
                    Writer.WriteStartElement("ehitise_osa_tehn_naitajad_tena_kood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsaTehnNaitajadTenaKood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsaTehnNaitajadTehnNaitNimetus!=null) {
                    Writer.WriteStartElement("ehitise_osa_tehn_naitajad_tehn_nait_nimetus");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsaTehnNaitajadTehnNaitNimetus))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsaTehnNaitajadJrkNr!=null) {
                    Writer.WriteStartElement("ehitise_osa_tehn_naitajad_jrk_nr");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsaTehnNaitajadJrkNr))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsaTehnNaitajadLisavaartus!=null) {
                    Writer.WriteStartElement("ehitise_osa_tehn_naitajad_lisavaartus");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsaTehnNaitajadLisavaartus))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsaTehnNaitajadSeotud!=null) {
                    Writer.WriteStartElement("ehitise_osa_tehn_naitajad_seotud");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsaTehnNaitajadSeotud))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsaTehnNaitajadDateCreated!=null) {
                    Writer.WriteStartElement("ehitise_osa_tehn_naitajad_date_created");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsaTehnNaitajadDateCreated))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitiseOsaTehnNaitajadValistav!=null) {
                    Writer.WriteStartElement("ehitise_osa_tehn_naitajad_valistav");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitiseOsaTehnNaitajadValistav))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="ehitise_osa_tehn_naitajad_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osa_tehn_naitajad_array>ehitise_osa_tehn_na" +
                                "itajad>ehitise_osa_tehn_naitajad_id");
                    }
                    clazz.EhitiseOsaTehnNaitajadId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ehitise_osa_tehn_naitajad_id")).Value;
                }
                if (Reader.LocalName=="ehitise_osa_tehn_naitajad_ehos_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osa_tehn_naitajad_array>ehitise_osa_tehn_na" +
                                "itajad>ehitise_osa_tehn_naitajad_ehos_id");
                    }
                    clazz.EhitiseOsaTehnNaitajadEhosId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ehitise_osa_tehn_naitajad_ehos_id")).Value;
                }
                if (Reader.LocalName=="ehitise_osa_tehn_naitajad_klty_nkood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osa_tehn_naitajad_array>ehitise_osa_tehn_na" +
                                "itajad>ehitise_osa_tehn_naitajad_klty_nkood");
                    }
                    clazz.EhitiseOsaTehnNaitajadKltyNkood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osa_tehn_naitajad_klty_nkood")).Value;
                }
                if (Reader.LocalName=="ehitise_osa_tehn_naitajad_tena_kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osa_tehn_naitajad_array>ehitise_osa_tehn_na" +
                                "itajad>ehitise_osa_tehn_naitajad_tena_kood");
                    }
                    clazz.EhitiseOsaTehnNaitajadTenaKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osa_tehn_naitajad_tena_kood")).Value;
                }
                if (Reader.LocalName=="ehitise_osa_tehn_naitajad_tehn_nait_nimetus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osa_tehn_naitajad_array>ehitise_osa_tehn_na" +
                                "itajad>ehitise_osa_tehn_naitajad_tehn_nait_nimetus");
                    }
                    clazz.EhitiseOsaTehnNaitajadTehnNaitNimetus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osa_tehn_naitajad_tehn_nait_nimetus")).Value;
                }
                if (Reader.LocalName=="ehitise_osa_tehn_naitajad_jrk_nr") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osa_tehn_naitajad_array>ehitise_osa_tehn_na" +
                                "itajad>ehitise_osa_tehn_naitajad_jrk_nr");
                    }
                    clazz.EhitiseOsaTehnNaitajadJrkNr = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osa_tehn_naitajad_jrk_nr")).Value;
                }
                if (Reader.LocalName=="ehitise_osa_tehn_naitajad_lisavaartus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osa_tehn_naitajad_array>ehitise_osa_tehn_na" +
                                "itajad>ehitise_osa_tehn_naitajad_lisavaartus");
                    }
                    clazz.EhitiseOsaTehnNaitajadLisavaartus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osa_tehn_naitajad_lisavaartus")).Value;
                }
                if (Reader.LocalName=="ehitise_osa_tehn_naitajad_seotud") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osa_tehn_naitajad_array>ehitise_osa_tehn_na" +
                                "itajad>ehitise_osa_tehn_naitajad_seotud");
                    }
                    clazz.EhitiseOsaTehnNaitajadSeotud = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osa_tehn_naitajad_seotud")).Value;
                }
                if (Reader.LocalName=="ehitise_osa_tehn_naitajad_date_created") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osa_tehn_naitajad_array>ehitise_osa_tehn_na" +
                                "itajad>ehitise_osa_tehn_naitajad_date_created");
                    }
                    clazz.EhitiseOsaTehnNaitajadDateCreated = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osa_tehn_naitajad_date_created")).Value;
                }
                if (Reader.LocalName=="ehitise_osa_tehn_naitajad_valistav") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitise_osa_tehn_naitajad_array>ehitise_osa_tehn_na" +
                                "itajad>ehitise_osa_tehn_naitajad_valistav");
                    }
                    clazz.EhitiseOsaTehnNaitajadValistav = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitise_osa_tehn_naitajad_valistav")).Value;
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>EN_EhitiseAndmed_response>ehitis_kasutamisotstarve_array>ehitis_kasutamisotsta" +
            "rve", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.EhitisKasutamisotstarveArrayType))]
        public class EhitisKasutamisotstarveArrayTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.IEhitisKasutamisotstarveArrayType clazz;
            
            public EhitisKasutamisotstarveArrayTypeSerializer(ENEhitiseAndmedResponse.IEhitisKasutamisotstarveArrayType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.EhitisKasutamisotstarveId!=null) {
                    Writer.WriteStartElement("ehitis_kasutamisotstarve_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.EhitisKasutamisotstarveId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisKasutamisotstarveEhitId!=null) {
                    Writer.WriteStartElement("ehitis_kasutamisotstarve_ehit_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.EhitisKasutamisotstarveEhitId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisKasutamisotstarveEhosId!=null) {
                    Writer.WriteStartElement("ehitis_kasutamisotstarve_ehos_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.EhitisKasutamisotstarveEhosId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisKasutamisotstarveKaosKood!=null) {
                    Writer.WriteStartElement("ehitis_kasutamisotstarve_kaos_kood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisKasutamisotstarveKaosKood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisKasutamisotstarveKaosNimetus!=null) {
                    Writer.WriteStartElement("ehitis_kasutamisotstarve_kaos_nimetus");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisKasutamisotstarveKaosNimetus))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.EhitisKasutamisotstarveDateCreated!=null) {
                    Writer.WriteStartElement("ehitis_kasutamisotstarve_date_created");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.EhitisKasutamisotstarveDateCreated))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="ehitis_kasutamisotstarve_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitis_kasutamisotstarve_array>ehitis_kasutamisotst" +
                                "arve>ehitis_kasutamisotstarve_id");
                    }
                    clazz.EhitisKasutamisotstarveId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ehitis_kasutamisotstarve_id")).Value;
                }
                if (Reader.LocalName=="ehitis_kasutamisotstarve_ehit_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitis_kasutamisotstarve_array>ehitis_kasutamisotst" +
                                "arve>ehitis_kasutamisotstarve_ehit_id");
                    }
                    clazz.EhitisKasutamisotstarveEhitId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ehitis_kasutamisotstarve_ehit_id")).Value;
                }
                if (Reader.LocalName=="ehitis_kasutamisotstarve_ehos_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitis_kasutamisotstarve_array>ehitis_kasutamisotst" +
                                "arve>ehitis_kasutamisotstarve_ehos_id");
                    }
                    clazz.EhitisKasutamisotstarveEhosId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("ehitis_kasutamisotstarve_ehos_id")).Value;
                }
                if (Reader.LocalName=="ehitis_kasutamisotstarve_kaos_kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitis_kasutamisotstarve_array>ehitis_kasutamisotst" +
                                "arve>ehitis_kasutamisotstarve_kaos_kood");
                    }
                    clazz.EhitisKasutamisotstarveKaosKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitis_kasutamisotstarve_kaos_kood")).Value;
                }
                if (Reader.LocalName=="ehitis_kasutamisotstarve_kaos_nimetus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitis_kasutamisotstarve_array>ehitis_kasutamisotst" +
                                "arve>ehitis_kasutamisotstarve_kaos_nimetus");
                    }
                    clazz.EhitisKasutamisotstarveKaosNimetus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitis_kasutamisotstarve_kaos_nimetus")).Value;
                }
                if (Reader.LocalName=="ehitis_kasutamisotstarve_date_created") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>ehitis_kasutamisotstarve_array>ehitis_kasutamisotst" +
                                "arve>ehitis_kasutamisotstarve_date_created");
                    }
                    clazz.EhitisKasutamisotstarveDateCreated = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("ehitis_kasutamisotstarve_date_created")).Value;
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.ArestidKeeludArrayType))]
        public class ArestidKeeludArrayTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.IArestidKeeludArrayType clazz;
            
            public ArestidKeeludArrayTypeSerializer(ENEhitiseAndmedResponse.IArestidKeeludArrayType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.ArestidKeeludId!=null) {
                    Writer.WriteStartElement("arestid_keelud_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.ArestidKeeludId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ArestidKeeludDokId!=null) {
                    Writer.WriteStartElement("arestid_keelud_dok_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ArestidKeeludDokId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ArestidKeeludArKe!=null) {
                    Writer.WriteStartElement("arestid_keelud_ar_ke");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ArestidKeeludArKe))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ArestidKeeludArKeTxt!=null) {
                    Writer.WriteStartElement("arestid_keelud_ar_ke_txt");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ArestidKeeludArKeTxt))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ArestidKeeludLiik!=null) {
                    Writer.WriteStartElement("arestid_keelud_liik");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ArestidKeeludLiik))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ArestidKeeludAlgusKp!=null) {
                    Writer.WriteStartElement("arestid_keelud_algus_kp");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ArestidKeeludAlgusKp))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ArestidKeeludLoppKp!=null) {
                    Writer.WriteStartElement("arestid_keelud_lopp_kp");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ArestidKeeludLoppKp))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ArestidKeeludMuudAndmed!=null) {
                    Writer.WriteStartElement("arestid_keelud_muud_andmed");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ArestidKeeludMuudAndmed))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ArestidKeeludEhitId!=null) {
                    Writer.WriteStartElement("arestid_keelud_ehit_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.ArestidKeeludEhitId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ArestidKeeludEhosId!=null) {
                    Writer.WriteStartElement("arestid_keelud_ehos_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ArestidKeeludEhosId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ArestidKeeludSeadjaId!=null) {
                    Writer.WriteStartElement("arestid_keelud_seadja_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.ArestidKeeludSeadjaId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ArestidKeeludLopetajaId!=null) {
                    Writer.WriteStartElement("arestid_keelud_lopetaja_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.ArestidKeeludLopetajaId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ArestidKeeludSeadjanimi!=null) {
                    Writer.WriteStartElement("arestid_keelud_seadjanimi");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ArestidKeeludSeadjanimi))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ArestidKeeludLopetajanimi!=null) {
                    Writer.WriteStartElement("arestid_keelud_lopetajanimi");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ArestidKeeludLopetajanimi))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ArestidKeeludDateCreated!=null) {
                    Writer.WriteStartElement("arestid_keelud_date_created");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ArestidKeeludDateCreated))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ArestidKeeludKeliKood!=null) {
                    Writer.WriteStartElement("arestid_keelud_keli_kood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ArestidKeeludKeliKood))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="arestid_keelud_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud>arestid_keelud_" +
                                "id");
                    }
                    clazz.ArestidKeeludId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("arestid_keelud_id")).Value;
                }
                if (Reader.LocalName=="arestid_keelud_dok_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud>arestid_keelud_" +
                                "dok_id");
                    }
                    clazz.ArestidKeeludDokId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("arestid_keelud_dok_id")).Value;
                }
                if (Reader.LocalName=="arestid_keelud_ar_ke") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud>arestid_keelud_" +
                                "ar_ke");
                    }
                    clazz.ArestidKeeludArKe = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("arestid_keelud_ar_ke")).Value;
                }
                if (Reader.LocalName=="arestid_keelud_ar_ke_txt") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud>arestid_keelud_" +
                                "ar_ke_txt");
                    }
                    clazz.ArestidKeeludArKeTxt = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("arestid_keelud_ar_ke_txt")).Value;
                }
                if (Reader.LocalName=="arestid_keelud_liik") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud>arestid_keelud_" +
                                "liik");
                    }
                    clazz.ArestidKeeludLiik = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("arestid_keelud_liik")).Value;
                }
                if (Reader.LocalName=="arestid_keelud_algus_kp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud>arestid_keelud_" +
                                "algus_kp");
                    }
                    clazz.ArestidKeeludAlgusKp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("arestid_keelud_algus_kp")).Value;
                }
                if (Reader.LocalName=="arestid_keelud_lopp_kp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud>arestid_keelud_" +
                                "lopp_kp");
                    }
                    clazz.ArestidKeeludLoppKp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("arestid_keelud_lopp_kp")).Value;
                }
                if (Reader.LocalName=="arestid_keelud_muud_andmed") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud>arestid_keelud_" +
                                "muud_andmed");
                    }
                    clazz.ArestidKeeludMuudAndmed = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("arestid_keelud_muud_andmed")).Value;
                }
                if (Reader.LocalName=="arestid_keelud_ehit_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud>arestid_keelud_" +
                                "ehit_id");
                    }
                    clazz.ArestidKeeludEhitId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("arestid_keelud_ehit_id")).Value;
                }
                if (Reader.LocalName=="arestid_keelud_ehos_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud>arestid_keelud_" +
                                "ehos_id");
                    }
                    clazz.ArestidKeeludEhosId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("arestid_keelud_ehos_id")).Value;
                }
                if (Reader.LocalName=="arestid_keelud_seadja_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud>arestid_keelud_" +
                                "seadja_id");
                    }
                    clazz.ArestidKeeludSeadjaId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("arestid_keelud_seadja_id")).Value;
                }
                if (Reader.LocalName=="arestid_keelud_lopetaja_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud>arestid_keelud_" +
                                "lopetaja_id");
                    }
                    clazz.ArestidKeeludLopetajaId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("arestid_keelud_lopetaja_id")).Value;
                }
                if (Reader.LocalName=="arestid_keelud_seadjanimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud>arestid_keelud_" +
                                "seadjanimi");
                    }
                    clazz.ArestidKeeludSeadjanimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("arestid_keelud_seadjanimi")).Value;
                }
                if (Reader.LocalName=="arestid_keelud_lopetajanimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud>arestid_keelud_" +
                                "lopetajanimi");
                    }
                    clazz.ArestidKeeludLopetajanimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("arestid_keelud_lopetajanimi")).Value;
                }
                if (Reader.LocalName=="arestid_keelud_date_created") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud>arestid_keelud_" +
                                "date_created");
                    }
                    clazz.ArestidKeeludDateCreated = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("arestid_keelud_date_created")).Value;
                }
                if (Reader.LocalName=="arestid_keelud_keli_kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>arestid_keelud_array>arestid_keelud>arestid_keelud_" +
                                "keli_kood");
                    }
                    clazz.ArestidKeeludKeliKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("arestid_keelud_keli_kood")).Value;
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>EN_EhitiseAndmed_response>omaniku_piirangud_array>omaniku_piirangud", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.OmanikuPiirangudArrayType))]
        public class OmanikuPiirangudArrayTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.IOmanikuPiirangudArrayType clazz;
            
            public OmanikuPiirangudArrayTypeSerializer(ENEhitiseAndmedResponse.IOmanikuPiirangudArrayType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.OmanikuPiirangudId!=null) {
                    Writer.WriteStartElement("omaniku_piirangud_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.OmanikuPiirangudId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.OmanikuPiirangudIsikId!=null) {
                    Writer.WriteStartElement("omaniku_piirangud_isik_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.OmanikuPiirangudIsikId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.OmanikuPiirangudArkeId!=null) {
                    Writer.WriteStartElement("omaniku_piirangud_arke_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.OmanikuPiirangudArkeId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.OmanikuPiirangudPantId!=null) {
                    Writer.WriteStartElement("omaniku_piirangud_pant_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.OmanikuPiirangudPantId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.OmanikuPiirangudIsikunimi!=null) {
                    Writer.WriteStartElement("omaniku_piirangud_isikunimi");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.OmanikuPiirangudIsikunimi))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.OmanikuPiirangudDateCreated!=null) {
                    Writer.WriteStartElement("omaniku_piirangud_date_created");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.OmanikuPiirangudDateCreated))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.OmanikuPiirangudIsikukood!=null) {
                    Writer.WriteStartElement("omaniku_piirangud_isikukood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.OmanikuPiirangudIsikukood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.OmanikuPiirangudRegKood!=null) {
                    Writer.WriteStartElement("omaniku_piirangud_reg_kood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.OmanikuPiirangudRegKood))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="omaniku_piirangud_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>omaniku_piirangud_array>omaniku_piirangud>omaniku_p" +
                                "iirangud_id");
                    }
                    clazz.OmanikuPiirangudId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("omaniku_piirangud_id")).Value;
                }
                if (Reader.LocalName=="omaniku_piirangud_isik_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>omaniku_piirangud_array>omaniku_piirangud>omaniku_p" +
                                "iirangud_isik_id");
                    }
                    clazz.OmanikuPiirangudIsikId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("omaniku_piirangud_isik_id")).Value;
                }
                if (Reader.LocalName=="omaniku_piirangud_arke_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>omaniku_piirangud_array>omaniku_piirangud>omaniku_p" +
                                "iirangud_arke_id");
                    }
                    clazz.OmanikuPiirangudArkeId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("omaniku_piirangud_arke_id")).Value;
                }
                if (Reader.LocalName=="omaniku_piirangud_pant_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>omaniku_piirangud_array>omaniku_piirangud>omaniku_p" +
                                "iirangud_pant_id");
                    }
                    clazz.OmanikuPiirangudPantId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("omaniku_piirangud_pant_id")).Value;
                }
                if (Reader.LocalName=="omaniku_piirangud_isikunimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>omaniku_piirangud_array>omaniku_piirangud>omaniku_p" +
                                "iirangud_isikunimi");
                    }
                    clazz.OmanikuPiirangudIsikunimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("omaniku_piirangud_isikunimi")).Value;
                }
                if (Reader.LocalName=="omaniku_piirangud_date_created") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>omaniku_piirangud_array>omaniku_piirangud>omaniku_p" +
                                "iirangud_date_created");
                    }
                    clazz.OmanikuPiirangudDateCreated = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("omaniku_piirangud_date_created")).Value;
                }
                if (Reader.LocalName=="omaniku_piirangud_isikukood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>omaniku_piirangud_array>omaniku_piirangud>omaniku_p" +
                                "iirangud_isikukood");
                    }
                    clazz.OmanikuPiirangudIsikukood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("omaniku_piirangud_isikukood")).Value;
                }
                if (Reader.LocalName=="omaniku_piirangud_reg_kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>omaniku_piirangud_array>omaniku_piirangud>omaniku_p" +
                                "iirangud_reg_kood");
                    }
                    clazz.OmanikuPiirangudRegKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("omaniku_piirangud_reg_kood")).Value;
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>EN_EhitiseAndmed_response>pandid_array>pandid", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.PandidArrayType))]
        public class PandidArrayTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.IPandidArrayType clazz;
            
            public PandidArrayTypeSerializer(ENEhitiseAndmedResponse.IPandidArrayType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.PandidId!=null) {
                    Writer.WriteStartElement("pandid_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.PandidId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.PandidDokId!=null) {
                    Writer.WriteStartElement("pandid_dok_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.PandidDokId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.PandidKeliKood!=null) {
                    Writer.WriteStartElement("pandid_keli_kood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PandidKeliKood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.PandidIsikId!=null) {
                    Writer.WriteStartElement("pandid_isik_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PandidIsikId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.PandidMuudAndmed!=null) {
                    Writer.WriteStartElement("pandid_muud_andmed");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PandidMuudAndmed))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.PandidAlgusKp!=null) {
                    Writer.WriteStartElement("pandid_algus_kp");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PandidAlgusKp))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.PandidLoppKp!=null) {
                    Writer.WriteStartElement("pandid_lopp_kp");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PandidLoppKp))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.PandidEhitId!=null) {
                    Writer.WriteStartElement("pandid_ehit_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.PandidEhitId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.PandidEhosId!=null) {
                    Writer.WriteStartElement("pandid_ehos_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.PandidEhosId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.PandidIsikunimi!=null) {
                    Writer.WriteStartElement("pandid_isikunimi");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PandidIsikunimi))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.PandidDateCreated!=null) {
                    Writer.WriteStartElement("pandid_date_created");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.PandidDateCreated))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="pandid_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>pandid_array>pandid>pandid_id");
                    }
                    clazz.PandidId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("pandid_id")).Value;
                }
                if (Reader.LocalName=="pandid_dok_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>pandid_array>pandid>pandid_dok_id");
                    }
                    clazz.PandidDokId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("pandid_dok_id")).Value;
                }
                if (Reader.LocalName=="pandid_keli_kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>pandid_array>pandid>pandid_keli_kood");
                    }
                    clazz.PandidKeliKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("pandid_keli_kood")).Value;
                }
                if (Reader.LocalName=="pandid_isik_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>pandid_array>pandid>pandid_isik_id");
                    }
                    clazz.PandidIsikId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("pandid_isik_id")).Value;
                }
                if (Reader.LocalName=="pandid_muud_andmed") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>pandid_array>pandid>pandid_muud_andmed");
                    }
                    clazz.PandidMuudAndmed = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("pandid_muud_andmed")).Value;
                }
                if (Reader.LocalName=="pandid_algus_kp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>pandid_array>pandid>pandid_algus_kp");
                    }
                    clazz.PandidAlgusKp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("pandid_algus_kp")).Value;
                }
                if (Reader.LocalName=="pandid_lopp_kp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>pandid_array>pandid>pandid_lopp_kp");
                    }
                    clazz.PandidLoppKp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("pandid_lopp_kp")).Value;
                }
                if (Reader.LocalName=="pandid_ehit_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>pandid_array>pandid>pandid_ehit_id");
                    }
                    clazz.PandidEhitId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("pandid_ehit_id")).Value;
                }
                if (Reader.LocalName=="pandid_ehos_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>pandid_array>pandid>pandid_ehos_id");
                    }
                    clazz.PandidEhosId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("pandid_ehos_id")).Value;
                }
                if (Reader.LocalName=="pandid_isikunimi") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>pandid_array>pandid>pandid_isikunimi");
                    }
                    clazz.PandidIsikunimi = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("pandid_isikunimi")).Value;
                }
                if (Reader.LocalName=="pandid_date_created") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>pandid_array>pandid>pandid_date_created");
                    }
                    clazz.PandidDateCreated = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("pandid_date_created")).Value;
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>EN_EhitiseAndmed_response>probleemid_array>probleemid", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.ProbleemidArrayType))]
        public class ProbleemidArrayTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.IProbleemidArrayType clazz;
            
            public ProbleemidArrayTypeSerializer(ENEhitiseAndmedResponse.IProbleemidArrayType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.ProbleemidId!=null) {
                    Writer.WriteStartElement("probleemid_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.ProbleemidId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ProbleemidEhrKood!=null) {
                    Writer.WriteStartElement("probleemid_ehr_kood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ProbleemidEhrKood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ProbleemidAnesId!=null) {
                    Writer.WriteStartElement("probleemid_anes_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ProbleemidAnesId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ProbleemidAnesIdTxt!=null) {
                    Writer.WriteStartElement("probleemid_anes_id_txt");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ProbleemidAnesIdTxt))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ProbleemidLiik!=null) {
                    Writer.WriteStartElement("probleemid_liik");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ProbleemidLiik))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ProbleemidLiikTxt!=null) {
                    Writer.WriteStartElement("probleemid_liik_txt");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ProbleemidLiikTxt))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ProbleemidSisu!=null) {
                    Writer.WriteStartElement("probleemid_sisu");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ProbleemidSisu))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ProbleemidMarkus!=null) {
                    Writer.WriteStartElement("probleemid_markus");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ProbleemidMarkus))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ProbleemidStaatus!=null) {
                    Writer.WriteStartElement("probleemid_staatus");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ProbleemidStaatus))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ProbleemidStaatusTxt!=null) {
                    Writer.WriteStartElement("probleemid_staatus_txt");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ProbleemidStaatusTxt))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ProbleemidUpdatedBy!=null) {
                    Writer.WriteStartElement("probleemid_updated_by");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ProbleemidUpdatedBy))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ProbleemidDateUpdated!=null) {
                    Writer.WriteStartElement("probleemid_date_updated");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ProbleemidDateUpdated))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="probleemid_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>probleemid_array>probleemid>probleemid_id");
                    }
                    clazz.ProbleemidId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("probleemid_id")).Value;
                }
                if (Reader.LocalName=="probleemid_ehr_kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>probleemid_array>probleemid>probleemid_ehr_kood");
                    }
                    clazz.ProbleemidEhrKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("probleemid_ehr_kood")).Value;
                }
                if (Reader.LocalName=="probleemid_anes_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>probleemid_array>probleemid>probleemid_anes_id");
                    }
                    clazz.ProbleemidAnesId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("probleemid_anes_id")).Value;
                }
                if (Reader.LocalName=="probleemid_anes_id_txt") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>probleemid_array>probleemid>probleemid_anes_id_txt");
                    }
                    clazz.ProbleemidAnesIdTxt = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("probleemid_anes_id_txt")).Value;
                }
                if (Reader.LocalName=="probleemid_liik") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>probleemid_array>probleemid>probleemid_liik");
                    }
                    clazz.ProbleemidLiik = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("probleemid_liik")).Value;
                }
                if (Reader.LocalName=="probleemid_liik_txt") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>probleemid_array>probleemid>probleemid_liik_txt");
                    }
                    clazz.ProbleemidLiikTxt = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("probleemid_liik_txt")).Value;
                }
                if (Reader.LocalName=="probleemid_sisu") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>probleemid_array>probleemid>probleemid_sisu");
                    }
                    clazz.ProbleemidSisu = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("probleemid_sisu")).Value;
                }
                if (Reader.LocalName=="probleemid_markus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>probleemid_array>probleemid>probleemid_markus");
                    }
                    clazz.ProbleemidMarkus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("probleemid_markus")).Value;
                }
                if (Reader.LocalName=="probleemid_staatus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>probleemid_array>probleemid>probleemid_staatus");
                    }
                    clazz.ProbleemidStaatus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("probleemid_staatus")).Value;
                }
                if (Reader.LocalName=="probleemid_staatus_txt") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>probleemid_array>probleemid>probleemid_staatus_txt");
                    }
                    clazz.ProbleemidStaatusTxt = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("probleemid_staatus_txt")).Value;
                }
                if (Reader.LocalName=="probleemid_updated_by") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>probleemid_array>probleemid>probleemid_updated_by");
                    }
                    clazz.ProbleemidUpdatedBy = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("probleemid_updated_by")).Value;
                }
                if (Reader.LocalName=="probleemid_date_updated") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>probleemid_array>probleemid>probleemid_date_updated" +
                                "");
                    }
                    clazz.ProbleemidDateUpdated = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("probleemid_date_updated")).Value;
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>EN_EhitiseAndmed_response>toalisuse_spetsid_array>toalisuse_spetsid", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.ToalisuseSpetsidArrayType))]
        public class ToalisuseSpetsidArrayTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.IToalisuseSpetsidArrayType clazz;
            
            public ToalisuseSpetsidArrayTypeSerializer(ENEhitiseAndmedResponse.IToalisuseSpetsidArrayType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.ToalisuseSpetsidId!=null) {
                    Writer.WriteStartElement("toalisuse_spetsid_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ToalisuseSpetsidId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ToalisuseSpetsidEhitId!=null) {
                    Writer.WriteStartElement("toalisuse_spetsid_ehit_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ToalisuseSpetsidEhitId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ToalisuseSpetsidToliKood!=null) {
                    Writer.WriteStartElement("toalisuse_spetsid_toli_kood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ToalisuseSpetsidToliKood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ToalisuseSpetsidKogus!=null) {
                    Writer.WriteStartElement("toalisuse_spetsid_kogus");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ToalisuseSpetsidKogus))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ToalisuseSpetsidPindala!=null) {
                    Writer.WriteStartElement("toalisuse_spetsid_pindala");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ToalisuseSpetsidPindala))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.ToalisuseSpetsidDateCreated!=null) {
                    Writer.WriteStartElement("toalisuse_spetsid_date_created");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.ToalisuseSpetsidDateCreated))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="toalisuse_spetsid_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>toalisuse_spetsid_array>toalisuse_spetsid>toalisuse" +
                                "_spetsid_id");
                    }
                    clazz.ToalisuseSpetsidId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("toalisuse_spetsid_id")).Value;
                }
                if (Reader.LocalName=="toalisuse_spetsid_ehit_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>toalisuse_spetsid_array>toalisuse_spetsid>toalisuse" +
                                "_spetsid_ehit_id");
                    }
                    clazz.ToalisuseSpetsidEhitId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("toalisuse_spetsid_ehit_id")).Value;
                }
                if (Reader.LocalName=="toalisuse_spetsid_toli_kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>toalisuse_spetsid_array>toalisuse_spetsid>toalisuse" +
                                "_spetsid_toli_kood");
                    }
                    clazz.ToalisuseSpetsidToliKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("toalisuse_spetsid_toli_kood")).Value;
                }
                if (Reader.LocalName=="toalisuse_spetsid_kogus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>toalisuse_spetsid_array>toalisuse_spetsid>toalisuse" +
                                "_spetsid_kogus");
                    }
                    clazz.ToalisuseSpetsidKogus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("toalisuse_spetsid_kogus")).Value;
                }
                if (Reader.LocalName=="toalisuse_spetsid_pindala") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>toalisuse_spetsid_array>toalisuse_spetsid>toalisuse" +
                                "_spetsid_pindala");
                    }
                    clazz.ToalisuseSpetsidPindala = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("toalisuse_spetsid_pindala")).Value;
                }
                if (Reader.LocalName=="toalisuse_spetsid_date_created") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>toalisuse_spetsid_array>toalisuse_spetsid>toalisuse" +
                                "_spetsid_date_created");
                    }
                    clazz.ToalisuseSpetsidDateCreated = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("toalisuse_spetsid_date_created")).Value;
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>EN_EhitiseAndmed_response>kujud", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.KujudType))]
        public class KujudTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.IKujudType clazz;
            
            public KujudTypeSerializer(ENEhitiseAndmedResponse.IKujudType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.KujudDateCreated!=null) {
                    Writer.WriteStartElement("kujud_date_created");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KujudDateCreated))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.KujudId!=null) {
                    Writer.WriteStartElement("kujud_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KujudId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.KujudEhitId!=null) {
                    Writer.WriteStartElement("kujud_ehit_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KujudEhitId))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="kujud_date_created") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>kujud>kujud_date_created");
                    }
                    clazz.KujudDateCreated = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kujud_date_created")).Value;
                }
                if (Reader.LocalName=="kujud_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>kujud>kujud_id");
                    }
                    clazz.KujudId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kujud_id")).Value;
                }
                if (Reader.LocalName=="kujud_ehit_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>kujud>kujud_ehit_id");
                    }
                    clazz.KujudEhitId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kujud_ehit_id")).Value;
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>EN_EhitiseAndmed_response>yks_kuju", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.YksKujuType))]
        public class YksKujuTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.IYksKujuType clazz;
            
            public YksKujuTypeSerializer(ENEhitiseAndmedResponse.IYksKujuType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.YksKujuId!=null) {
                    Writer.WriteStartElement("yks_kuju_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.YksKujuId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.YksKujuKujuId!=null) {
                    Writer.WriteStartElement("yks_kuju_kuju_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.YksKujuKujuId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.YksKujuNimetus!=null) {
                    Writer.WriteStartElement("yks_kuju_nimetus");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.YksKujuNimetus))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.YksKujuTyyp!=null) {
                    Writer.WriteStartElement("yks_kuju_tyyp");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.YksKujuTyyp))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.YksKujuSeoseId!=null) {
                    Writer.WriteStartElement("yks_kuju_seose_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.YksKujuSeoseId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.YksKujuDateCreated!=null) {
                    Writer.WriteStartElement("yks_kuju_date_created");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.YksKujuDateCreated))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="yks_kuju_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>yks_kuju>yks_kuju_id");
                    }
                    clazz.YksKujuId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("yks_kuju_id")).Value;
                }
                if (Reader.LocalName=="yks_kuju_kuju_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>yks_kuju>yks_kuju_kuju_id");
                    }
                    clazz.YksKujuKujuId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("yks_kuju_kuju_id")).Value;
                }
                if (Reader.LocalName=="yks_kuju_nimetus") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>yks_kuju>yks_kuju_nimetus");
                    }
                    clazz.YksKujuNimetus = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("yks_kuju_nimetus")).Value;
                }
                if (Reader.LocalName=="yks_kuju_tyyp") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>yks_kuju>yks_kuju_tyyp");
                    }
                    clazz.YksKujuTyyp = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("yks_kuju_tyyp")).Value;
                }
                if (Reader.LocalName=="yks_kuju_seose_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>yks_kuju>yks_kuju_seose_id");
                    }
                    clazz.YksKujuSeoseId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("yks_kuju_seose_id")).Value;
                }
                if (Reader.LocalName=="yks_kuju_date_created") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>yks_kuju>yks_kuju_date_created");
                    }
                    clazz.YksKujuDateCreated = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("yks_kuju_date_created")).Value;
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>EN_EhitiseAndmed_response>kuju_koordinaadid_array>kuju_koordinaadid", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.KujuKoordinaadidArrayType))]
        public class KujuKoordinaadidArrayTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.IKujuKoordinaadidArrayType clazz;
            
            public KujuKoordinaadidArrayTypeSerializer(ENEhitiseAndmedResponse.IKujuKoordinaadidArrayType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.KujuKoordinaadidId!=null) {
                    Writer.WriteStartElement("kuju_koordinaadid_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KujuKoordinaadidId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.KujuKoordinaadidYksKujuId!=null) {
                    Writer.WriteStartElement("kuju_koordinaadid_yks_kuju_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KujuKoordinaadidYksKujuId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.KujuKoordinaadidPiir!=null) {
                    Writer.WriteStartElement("kuju_koordinaadid_piir");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KujuKoordinaadidPiir))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.KujuKoordinaadidX!=null) {
                    Writer.WriteStartElement("kuju_koordinaadid_x");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KujuKoordinaadidX))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.KujuKoordinaadidY!=null) {
                    Writer.WriteStartElement("kuju_koordinaadid_y");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KujuKoordinaadidY))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.KujuKoordinaadidDateCreated!=null) {
                    Writer.WriteStartElement("kuju_koordinaadid_date_created");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KujuKoordinaadidDateCreated))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="kuju_koordinaadid_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>kuju_koordinaadid_array>kuju_koordinaadid>kuju_koor" +
                                "dinaadid_id");
                    }
                    clazz.KujuKoordinaadidId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kuju_koordinaadid_id")).Value;
                }
                if (Reader.LocalName=="kuju_koordinaadid_yks_kuju_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>kuju_koordinaadid_array>kuju_koordinaadid>kuju_koor" +
                                "dinaadid_yks_kuju_id");
                    }
                    clazz.KujuKoordinaadidYksKujuId = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kuju_koordinaadid_yks_kuju_id")).Value;
                }
                if (Reader.LocalName=="kuju_koordinaadid_piir") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>kuju_koordinaadid_array>kuju_koordinaadid>kuju_koor" +
                                "dinaadid_piir");
                    }
                    clazz.KujuKoordinaadidPiir = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kuju_koordinaadid_piir")).Value;
                }
                if (Reader.LocalName=="kuju_koordinaadid_x") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>kuju_koordinaadid_array>kuju_koordinaadid>kuju_koor" +
                                "dinaadid_x");
                    }
                    clazz.KujuKoordinaadidX = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kuju_koordinaadid_x")).Value;
                }
                if (Reader.LocalName=="kuju_koordinaadid_y") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>kuju_koordinaadid_array>kuju_koordinaadid>kuju_koor" +
                                "dinaadid_y");
                    }
                    clazz.KujuKoordinaadidY = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kuju_koordinaadid_y")).Value;
                }
                if (Reader.LocalName=="kuju_koordinaadid_date_created") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>kuju_koordinaadid_array>kuju_koordinaadid>kuju_koor" +
                                "dinaadid_date_created");
                    }
                    clazz.KujuKoordinaadidDateCreated = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kuju_koordinaadid_date_created")).Value;
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>EN_EhitiseAndmed_response>anon_ehr_lingid", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.AnonEhrLingidType))]
        public class AnonEhrLingidTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.IAnonEhrLingidType clazz;
            
            public AnonEhrLingidTypeSerializer(ENEhitiseAndmedResponse.IAnonEhrLingidType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.AnonEhrLingidMaterjalid!=null) {
                    Writer.WriteStartElement("anon_ehr_lingid_materjalid");
                    Writer.WriteTypeAttribute("http://x-tee.riik.ee/xsd/xtee.xsd", "url");
                    Writer.WriteString(clazz.AnonEhrLingidMaterjalid.ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.AnonEhrLingidTehnosysteemid!=null) {
                    Writer.WriteStartElement("anon_ehr_lingid_tehnosysteemid");
                    Writer.WriteTypeAttribute("http://x-tee.riik.ee/xsd/xtee.xsd", "url");
                    Writer.WriteString(clazz.AnonEhrLingidTehnosysteemid.ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.AnonEhrLingidDokumendid!=null) {
                    Writer.WriteStartElement("anon_ehr_lingid_dokumendid");
                    Writer.WriteTypeAttribute("http://x-tee.riik.ee/xsd/xtee.xsd", "url");
                    Writer.WriteString(clazz.AnonEhrLingidDokumendid.ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.AnonEhrLingidEhitiseosad!=null) {
                    Writer.WriteStartElement("anon_ehr_lingid_ehitiseosad");
                    Writer.WriteTypeAttribute("http://x-tee.riik.ee/xsd/xtee.xsd", "url");
                    Writer.WriteString(clazz.AnonEhrLingidEhitiseosad.ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.AnonEhrLingidMuudAndmed!=null) {
                    Writer.WriteStartElement("anon_ehr_lingid_muud_andmed");
                    Writer.WriteTypeAttribute("http://x-tee.riik.ee/xsd/xtee.xsd", "url");
                    Writer.WriteString(clazz.AnonEhrLingidMuudAndmed.ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="anon_ehr_lingid_materjalid") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>anon_ehr_lingid>anon_ehr_lingid_materjalid");
                    }
                    clazz.AnonEhrLingidMaterjalid = new global::Xtee.Riik.Ee.Xsd.Xtee.Url(Reader.ReadElementString("anon_ehr_lingid_materjalid"));
                }
                if (Reader.LocalName=="anon_ehr_lingid_tehnosysteemid") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>anon_ehr_lingid>anon_ehr_lingid_tehnosysteemid");
                    }
                    clazz.AnonEhrLingidTehnosysteemid = new global::Xtee.Riik.Ee.Xsd.Xtee.Url(Reader.ReadElementString("anon_ehr_lingid_tehnosysteemid"));
                }
                if (Reader.LocalName=="anon_ehr_lingid_dokumendid") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>anon_ehr_lingid>anon_ehr_lingid_dokumendid");
                    }
                    clazz.AnonEhrLingidDokumendid = new global::Xtee.Riik.Ee.Xsd.Xtee.Url(Reader.ReadElementString("anon_ehr_lingid_dokumendid"));
                }
                if (Reader.LocalName=="anon_ehr_lingid_ehitiseosad") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>anon_ehr_lingid>anon_ehr_lingid_ehitiseosad");
                    }
                    clazz.AnonEhrLingidEhitiseosad = new global::Xtee.Riik.Ee.Xsd.Xtee.Url(Reader.ReadElementString("anon_ehr_lingid_ehitiseosad"));
                }
                if (Reader.LocalName=="anon_ehr_lingid_muud_andmed") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>EN_EhitiseAndmed_response>anon_ehr_lingid>anon_ehr_lingid_muud_andmed");
                    }
                    clazz.AnonEhrLingidMuudAndmed = new global::Xtee.Riik.Ee.Xsd.Xtee.Url(Reader.ReadElementString("anon_ehr_lingid_muud_andmed"));
                }
            }
        }
        
        [global::Xtee.Core.Attributes.XmlTypeAttribute(Name=">>>EN_EhitiseAndmed_response>kasuliku_pinna_spets_array>kasuliku_pinna_spets", Namespace="http://producers.ehr.xtee.riik.ee/producer/ehr", Target=typeof(ENEhitiseAndmedResponse.KasulikuPinnaSpetsArrayType))]
        public class KasulikuPinnaSpetsArrayTypeSerializer : global::Xtee.Core.Types.AbstractXteeSerializable {
            
            protected ENEhitiseAndmedResponse.IKasulikuPinnaSpetsArrayType clazz;
            
            public KasulikuPinnaSpetsArrayTypeSerializer(ENEhitiseAndmedResponse.IKasulikuPinnaSpetsArrayType clazz) {
                this.clazz = clazz;
            }
            
            public override void WriteXml(global::Xtee.Core.IXteeXmlWriter Writer) {
                base.WriteXml(Writer);
                if (clazz.KasulikuPinnaSpetsId!=null) {
                    Writer.WriteStartElement("kasuliku_pinna_spets_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.KasulikuPinnaSpetsId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.KasulikuPinnaSpetsEhkoId!=null) {
                    Writer.WriteStartElement("kasuliku_pinna_spets_ehko_id");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "integer");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdInteger(((decimal)(clazz.KasulikuPinnaSpetsEhkoId))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.KasulikuPinnaSpetsKapkKood!=null) {
                    Writer.WriteStartElement("kasuliku_pinna_spets_kapk_kood");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KasulikuPinnaSpetsKapkKood))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.KasulikuPinnaSpetsPind!=null) {
                    Writer.WriteStartElement("kasuliku_pinna_spets_pind");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KasulikuPinnaSpetsPind))).ToString());
                    Writer.WriteEndElement();
                }
                if (clazz.KasulikuPinnaSpetsDateCreated!=null) {
                    Writer.WriteStartElement("kasuliku_pinna_spets_date_created");
                    Writer.WriteTypeAttribute("http://www.w3.org/2001/XMLSchema", "string");
                    Writer.WriteString(new global::Xtee.Core.Schema.XsdString(((string)(clazz.KasulikuPinnaSpetsDateCreated))).ToString());
                    Writer.WriteEndElement();
                }
            }
            
            public override void ReadXml(global::Xtee.Core.IXteeXmlReader Reader) {
                base.ReadXml(Reader);
                if (Reader.LocalName=="kasuliku_pinna_spets_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>kasuliku_pinna_spets_array>kasuliku_pinna_spets>kas" +
                                "uliku_pinna_spets_id");
                    }
                    clazz.KasulikuPinnaSpetsId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("kasuliku_pinna_spets_id")).Value;
                }
                if (Reader.LocalName=="kasuliku_pinna_spets_ehko_id") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>kasuliku_pinna_spets_array>kasuliku_pinna_spets>kas" +
                                "uliku_pinna_spets_ehko_id");
                    }
                    clazz.KasulikuPinnaSpetsEhkoId = new global::Xtee.Core.Schema.XsdInteger(Reader.ReadElementString("kasuliku_pinna_spets_ehko_id")).Value;
                }
                if (Reader.LocalName=="kasuliku_pinna_spets_kapk_kood") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>kasuliku_pinna_spets_array>kasuliku_pinna_spets>kas" +
                                "uliku_pinna_spets_kapk_kood");
                    }
                    clazz.KasulikuPinnaSpetsKapkKood = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kasuliku_pinna_spets_kapk_kood")).Value;
                }
                if (Reader.LocalName=="kasuliku_pinna_spets_pind") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>kasuliku_pinna_spets_array>kasuliku_pinna_spets>kas" +
                                "uliku_pinna_spets_pind");
                    }
                    clazz.KasulikuPinnaSpetsPind = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kasuliku_pinna_spets_pind")).Value;
                }
                if (Reader.LocalName=="kasuliku_pinna_spets_date_created") {
                    if (Reader.IsElementNil()) {
                        throw new global::Xtee.Core.Exceptions.NillableNotAllowedException(">>>>EN_EhitiseAndmed_response>kasuliku_pinna_spets_array>kasuliku_pinna_spets>kas" +
                                "uliku_pinna_spets_date_created");
                    }
                    clazz.KasulikuPinnaSpetsDateCreated = new global::Xtee.Core.Schema.XsdString(Reader.ReadElementString("kasuliku_pinna_spets_date_created")).Value;
                }
            }
        }
    }
}
